cross-platform constants

Just starting out? Need help? Post your questions and find answers here.
chen
Enthusiast
Enthusiast
Posts: 338
Joined: Fri Dec 23, 2005 2:20 pm
Location: Quebec, Canada
Contact:

cross-platform constants

Post 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:
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post 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)
@}--`--,-- A rose by any other name ..
Post Reply