Revision history for FaqPgrtlib


Revision [20803]

Last edited on 2016-03-12 14:12:29 by fxm [Formatting]
Additions:


Revision [20011]

Edited on 2016-02-10 15:52:29 by DkLwikki [Update link format]
Additions:
If what's required is to play .wav or .mp3 files thru a soundcard, external libraries as FMOD or BASS can be used in Linux and Windows. For DOS see the [[FaqDOS|DOS FAQ section]].
See [[FaqDOS|DOS FAQ section]].
See [[KeyPgOpenCom|Open Com]].
- Preprocess the graphics data, program the printer, and send the data to it (see [[http://en.wikipedia.org/wiki/ESC/P|wikipedia.org/wiki/ESC/P]]). This is OS-portable but depends on the printer model. The only way for DOS, see also [[FaqDOS|DOS FAQ section]].
- [[CompilerFAQ|Compiler FAQ]]
- [[FaqPggfxlib2|Frequently Asked FreeBASIC Graphics Library Questions]]
- [[FaqPgWin32|Win32 related FAQ]]
- [[FaqDOS|DOS related FAQ]]
Deletions:
If what's required is to play .wav or .mp3 files thru a soundcard, external libraries as FMOD or BASS can be used in Linux and Windows. For DOS see the [[FaqDOS DOS FAQ section]].
See [[FaqDOS DOS FAQ section]].
See [[KeyPgOpenCom Open Com]].
- Preprocess the graphics data, program the printer, and send the data to it (see [[http://en.wikipedia.org/wiki/ESC/P wikipedia.org/wiki/ESC/P]]). This is OS-portable but depends on the printer model. The only way for DOS, see also [[FaqDOS DOS FAQ section]].
- [[CompilerFAQ Compiler FAQ]]
- [[FaqPggfxlib2 Frequently Asked FreeBASIC Graphics Library Questions]]
- [[FaqPgWin32 Win32 related FAQ]]
- [[FaqDOS DOS related FAQ]]


Revision [17404]

Edited on 2014-12-31 07:33:17 by DoS386 [printing and ...]
Additions:
Since version 0.15 FB supports character output to printer.
- Preprocess the graphics data, program the printer, and send the data to it (see [[http://en.wikipedia.org/wiki/ESC/P wikipedia.org/wiki/ESC/P]]). This is OS-portable but depends on the printer model. The only way for DOS, see also [[FaqDOS DOS FAQ section]].
- In Windows and Linux there are specific API calls. This is not OS-portable but the OS's printer driver makes it printer-independent.
INP, OUT and WAIT known from QB are implemented since version 0.15 of FB.
The GfxLib intercepts the calls to some VGA ports to emulate the widely used QB's palette manipulation and vsync methods. So ports &H3DA, &H3C7, &H3C8 and &H3C9 can't be accessed it GfxLib is used. All other ports are accessible.
No further tricks are required to use INP and OUT in Linux or DOS. For the Windows version the required device driver is installed each first time the program is run in a windows session; this requires Administrator rights for this first run or the program will end with an error. Note that accessing hardware ports by applications is not common practice in Windows and Linux.
Deletions:
Since version 0.15 FB supports character output to printer.
- Preprocess the graphics, program the printer and send the pixels in FB. This is OS-portable but depends on the printer model. The only way for DOS, see also [[FaqDOS DOS FAQ section]].
- In Windows and Linux there are specific API calls. This is not OS-portable but the OS's printer driver makes it printer-independent
As of V0.15 QB's INP, OUT and WAIT are implemented.
The GfxLib intercepts the calls to some VGA ports to emulate the widely used QB's palete manipulation and vsync methods. So ports &H3DA, &H3C7, &H3C8 and &H3C9 can't be accessed it GfxLib is used. All other ports are accessible.
No further care is required to use INP and OUT in Linux or DOS. For the Windows version the required device driver is installed each first time the program is run in a windows session; this requires Administrator rights for this first run or the program will end with an error.


Revision [17017]

Edited on 2014-03-20 11:56:06 by DkLwikki [Remove Byval As String notes, as it's now implemented properly]
Deletions:
==- {{anchor name="item5|What is the behavior of strings passed byval?"}}==
{{anchor name="item5"}}==What is the behavior of strings passed byval?==
~&This item is written as of 01.30.2007.
A ""FreeBASIC"" [[KeyPgString String]] is essentially a built-in user-defined type that, among other things, contains a pointer to the string data and its length. This type is called a 'descriptor' internally, and it is this descriptor that is passed to procedures when its parameters are passed by reference.
When passed by value, however, the actual string data is passed, not the descriptor. Internally, the string data is terminated with the NULL character (chr(0)). When the temporary [[KeyPgString String]] is created for the procedure, ""FreeBASIC"" copies the string data passed up until the first NULL character. If the [[KeyPgString String]] argument passed contained NULL characters within the string, then the rest of the string data after the first NULL is not copied, and the string is truncated. You also run the risk of writing outside the bounds of the allocated memory.
This behavior will eventually be fixed to act as it should: a temporary descriptor will be created for the procedure and a 'deep copy' of its fields will be made (notably, the entire string data itself will be copied into new memory, and the new descriptor will point to that memory).
To be safe, pass [[KeyPgString Strings]] by reference. If you need to simulate the correct behavior of passing a [[KeyPgString String]] by value, either 1) create a temporary [[KeyPgString String]], initialize it with the [[KeyPgString String]] you want to pass and pass the temporary by reference, or 2) pass the [[KeyPgString String]] by reference and have the procedure create and initialize a temporary [[KeyPgString String]] and work with the temporary.


Revision [16248]

Edited on 2012-08-11 19:18:43 by CountingPine [it's -> its]
Additions:
A ""FreeBASIC"" [[KeyPgString String]] is essentially a built-in user-defined type that, among other things, contains a pointer to the string data and its length. This type is called a 'descriptor' internally, and it is this descriptor that is passed to procedures when its parameters are passed by reference.
This behavior will eventually be fixed to act as it should: a temporary descriptor will be created for the procedure and a 'deep copy' of its fields will be made (notably, the entire string data itself will be copied into new memory, and the new descriptor will point to that memory).
Deletions:
A ""FreeBASIC"" [[KeyPgString String]] is essentially a built-in user-defined type that, among other things, contains a pointer to the string data and it's length. This type is called a 'descriptor' internally, and it is this descriptor that is passed to procedures when it's parameters are passed by reference.
This behavior will eventually be fixed to act as it should: a temporary descriptor will be created for the procedure and a 'deep copy' of it's fields will be made (notably, the entire string data itself will be copied into new memory, and the new descriptor will point to that memory).


Revision [15766]

Edited on 2012-01-23 02:30:29 by CountingPine [Proper See Also link]
Additions:
{{fbdoc item="see"}}
Deletions:
See also:


Revision [15317]

Edited on 2011-10-01 10:57:43 by DkLwikki [Remove CamelCase link]
Additions:
**""FreeBASIC"" Runtime Library questions:**
@@**""FreeBASIC"" Runtime Library questions**@@
A ""FreeBASIC"" [[KeyPgString String]] is essentially a built-in user-defined type that, among other things, contains a pointer to the string data and it's length. This type is called a 'descriptor' internally, and it is this descriptor that is passed to procedures when it's parameters are passed by reference.
When passed by value, however, the actual string data is passed, not the descriptor. Internally, the string data is terminated with the NULL character (chr(0)). When the temporary [[KeyPgString String]] is created for the procedure, ""FreeBASIC"" copies the string data passed up until the first NULL character. If the [[KeyPgString String]] argument passed contained NULL characters within the string, then the rest of the string data after the first NULL is not copied, and the string is truncated. You also run the risk of writing outside the bounds of the allocated memory.
Deletions:
**FreeBASIC Runtime Library questions:**
@@**FreeBASIC Runtime Library questions**@@
A FreeBASIC [[KeyPgString String]] is essentially a built-in user-defined type that, among other things, contains a pointer to the string data and it's length. This type is called a 'descriptor' internally, and it is this descriptor that is passed to procedures when it's parameters are passed by reference.
When passed by value, however, the actual string data is passed, not the descriptor. Internally, the string data is terminated with the NULL character (chr(0)). When the temporary [[KeyPgString String]] is created for the procedure, FreeBASIC copies the string data passed up until the first NULL character. If the [[KeyPgString String]] argument passed contained NULL characters within the string, then the rest of the string data after the first NULL is not copied, and the string is truncated. You also run the risk of writing outside the bounds of the allocated memory.


Revision [14785]

Edited on 2010-08-21 00:50:26 by GaLeon [Remove CamelCase link]
Additions:
{{fbdoc item="title" value="Frequently Asked FB Runtime Library Questions"}}----
**FreeBASIC Runtime Library questions:**
@@**FreeBASIC Runtime Library questions**@@
Deletions:
{{fbdoc item="title" value="Frequently Asked FB Run-Time Library Questions"}}----
**FreeBASIC Run-Time Library questions:**
@@**FreeBASIC Run-Time Library questions**@@


Revision [12707]

The oldest known version of this page was created on 2008-03-11 22:15:29 by DoS386 [Remove CamelCase link]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode