FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

FB II COMPILER

Understand the meaning of _"XXXX"



An expression like _"TEXT" is actually a long-integer constant. A long integer always takes up 4 bytes, and in this case those 4 bytes have exaclty the same binary contents as the 4 character in the quoted string. Normally, there's no earthly reason why you'd want a long integer whose binary equivalent is the same as 4 ASCII characters, except that the MacOS uses them all the time. File types, creator signatures, resource types, apple event types, etc. all have this dual "long integer/ASCII string" nature: they're all passed as long integers, but are more easily recognized as 4-character strings.

Rick


ThisVariable& = _"xxxx" is same as ThisVariable& = CVI("xxxx")

The convert to integer takes a four character string and relaces it with the four hex values to create the four bytes osType variable often referred in Inside Macintosh.

Deep