Author Topic: IMPORT default params  (Read 1412 times)

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2626
    • View Profile
IMPORT default params
« on: 2011-Sep-07 »
A small example will explain this better...

Code: GLBasic [Select]
IMPORT "C" int __stdcall foo(int mesh, float px, float py, float pz)

could have the syntax

Code: GLBasic [Select]
IMPORT "C" int __stdcall foo(int mesh, float px=1, float py=1, float pz=1)

allowing

Code: GLBasic [Select]
foo(10)

which equates to...

Code: GLBasic [Select]
foo(10,1,1,1)


Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)