Page 1 of 1

cross-platform constants

Posted: Sat May 27, 2006 3:26 pm
by chen
Hi,

Im developing and almost finish a Search and Replace Application... until now
it's croos-platform (I suppose, only #PB_constants, no CallBacks :?)
But I dont know exactly which constants are cross-platform and which are not.

For example: is this code cross-platform?

Code: Select all

Select MessageRequester("Oen", "<<<<<< Important!!! " + Chr(10) + "1.- Line mode  works only in complete line if wildchars are used." + Chr(10) + "     in all replacement operations (delete,replace,insert)." + Chr(10) + "2.- Block mode.... same behavior with or without wildchars >>>>>>>>>", #MB_OKCANCEL|#MB_ICONINFORMATION)
   Case #IDOK
   Case #IDCANCEL
EndSelect
or Im restricted only to constants starting with #PB_

Could you give me some tips? :cry:

Posted: Sat May 27, 2006 4:02 pm
by Dare2
I would say that the #MB* and #ID* constants are windows-specific, unless Fred has specifically put them into the other platforms. I am not sure what the linux or mac-os equivalents are. But you could perhaps use your own and "includefile" those constants for the platform, eg:

Windows include file:

Code: Select all

#my_ICONERROR = #MB_ICONERROR
Linux include file:

Code: Select all

#my_ICONERROR = 16 ; or whatever it is
Mac-OS include file:

Code: Select all

#my_ICONERROR = #MACOS_ICONERROR ; or whatever it is
Then only those small files differ on your linux/MacOS/Windows systems.

You then use:

Code: Select all

MessageRequester("Oen","Long message",#my_whatever)