Author Topic: IMPORT default params  (Read 1527 times)

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2658
    • 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)