text file database, moving from Mac OsX to windows
Klaus Major
klaus at major-k.de
Mon Feb 7 09:41:30 EST 2005
Bonjour Phillipe,
> Hello,
> i'm sorry if i might be unpolite, it is not a will but just may be
> unexperience, i use to be lonesome!
> so if I say or do something wrong, please tell me, teach me.
>
> Well this is my problem:
> i'm a french radiologist, and i develop under hypercard since 1989.
> recently i switched to Revolution (what a wonder!) a began to develop
> a stack, designed to be a professionnal rendez vous planner.
> The deal was to make a multi-User data base, text based with a single
> card stack front user interface.
> Now it is OK under Mac OSX for single User, and i believe for multi
> Users also, but it is diificult to test with a single computer.
> so I compiled for windows to begin the tests, single user before multi
> users.
> After minor corrections there was no problem to run under windows OS,
> but there I encountered a real surprise: the immediate corruption of
> the text file
> by the Windows interface, probably because of writing file at the
> wrong place.
> At least the inscriptions in the text file are not same as under
> MacOSX, because in one case it works correctly and in the other it is
> awful !!!
> Is there a different way to count the place of the first char on one
> platform or other?
> Is there a difference in the length of a chain (for instance one
> platform count the returns and the other not?)
> I don't understand!
> if someone knows about that problem, please give me a hand, because
> i'm a bit bothered about it now!
> if someone wants to see the stack, no problem, i give it, it was a
> funny work and runs pretty well under Mac (however i have to say that
> it is very specific to our organisation)
welcome to the wonderful world of crossplatform development :-)
There is a difference between mac and win in the way text (strings) are
encoded,
which is especially important in a language with umlauts and accents
like french!
I guess the text is created on a mac and "only" displayed on windows,
right?
In that case you would have to convert the text from mac to ISO
encoding to display it correctly
on windows...
I do something like this, since i also create text on my mac, but will
display it on windows, too...
I use this function to convert "mac" text for each according platform:
function mac_or_win tText
if the platform contains "Mac" then
return tText
## we are on a mac an can display the text without having to convert
else
return MacToIso(tText)
## we are on win or *nix and so need to tranlate from Mac to ISO
encoding!
end if
end mac_or_win
And then i use it like:
...
put mac_or_win(line 1 to 3 of fld "mactext") into fld "display"
...
Hope that helps.
> before all i thank you for your help
> Philippe Giraudet
Regards
Klaus Major
klaus at major-k.de
http://www.major-k.de
More information about the use-livecode
mailing list