An example:
Code: Select all
Result = CreateFile(#File, Filename$ [, Flags])
Flags (optional)
It can be a combination (using the '| operand) of the following values:
#PB_File_SharedRead : the opened file can be read by another process (Windows only).
#PB_File_SharedWrite: the opened file can be write by another process (Windows only).
#PB_File_NoBuffering: the internal PureBasic file buffering system will be disabled for this file.
#PB_File_NoBuffering if I don't want buffering, but if I want it ? 0 ? -1 ? #PB_Default, #PB_Ignore ? Something else ?
The alternative is to write an IF/ELSE/ENDIF with two calls to CreateFile(), one with #PB_File_NoBuffering and one without the optional param, but this should be not required.
Another example: suppose I want to redefine a PB command through a macro with the same name, maybe I just do something in addition to the original command and then I need to call it anyway. Maybe I'm tracing the command execution, or I'm doing something like this -> NoLeak.
If the command has optional params, and I don't know their defaults, how can I write the macro ?
Code: Select all
Result = CatchImage(#Image, *MemoryAddress [, Size])
Same type of problem selected at random from the helpfile:
Code: Select all
Result = CRC32Fingerprint(*Buffer, Size [, InitialValue])
Result$ = SHA1FileFingerprint(Filename$ [, Offset [, Length]])
Filename$ = GetFilePart(FullPathName$ [, Mode])
UnbindEvent(Event, @Callback() [, Window [, Object [, EventType]]])
DrawAlphaImage(ImageID, x, y [, ConstAlpha])
...
CreateImage() is one of the commands which gives this info:
Code: Select all
Result = CreateImage(#Image, Width, Height [, Depth [, BackColor]])
Depth (optional) The color depth for the new image. Valid values can be: 24 and 32. The default is 24-bit if no depth is specified.
BackColor (optional) The back RGB() color used when the image is created. This color can be set to #PB_Image_Transparent to create an image with the alpha channel set to full transparent. This only has an effect on 32-bit images. The default backcolor is black if not specified.
Code: Select all
Box(x, y, Width, Height [, Color])
Color (optional) The color to be used for the box. If this parameter is not specified, the default color set with FrontColor() will be used. This color can be in RGB or RGBA format.
I can write a program (or many, for different OSes) to hopefully discover that but it should be in the docs, probably in the help for FrontColor().
I shouldn't have to try to guess, I should just have to read the docs.
I don't know if this is more appropriate here or in Feature Requests, in case please move it.