44
so close but so far.
// --------------------------------- //
// Project:
// Start: Monday, October 23, 2006
// IDE Version: 3.283
// LET is dead. Please leave it.
lt=1
chip=1
info=10
// a function must be called with ( )
startup()
setltp(lt)
setoutput(chip)
output(chip, info)
END
INLINE
extern "C" double (__stdcall* start_8000) = 0;
extern "C" double (__stdcall* SelectI2CprinterPort) (long lt) = 0;
extern "C" double (__stdcall* ConfigIOchipAsOutput) (long chip) = 0;
extern "C" double (__stdcall* IOoutput) (long chip, long info) = 0;
DLLCALL("K8D.dll", "start_8000", (void**) &start_8000);
DLLCALL("K8D.dll", "SelectI2CprinterPort", (void**) &SelectI2CprinterPort);
DLLCALL("K8D.dll", "ConfigIOchipAsOutput", (void**) &ConfigIOchipAsOutput);
DLLCALL("K8D.dll", "IOoutput", (void**) &IOoutput);
ENDINLINE
// You must "end" the main game function
// this is done by forcing another function to
// begin and end
FUNCTION dummy:
ENDFUNCTION
FUNCTION startup:
INLINE
// in C++ always call functions with ( )
// and end a command with ';'
// also, check if the function could be loaded first:
IF (start_8000) // function pointer is good
{
start_8000();
}
ELSE
{
PRINT("Can't load function", 100, 100);
SHOWSCREEN();
MOUSEWAIT();
END();
}
ENDINLINE
ENDFUNCTION
FUNCTION setltp: it
INLINE
SelectI2CprinterPort (it); // semicolon
ENDINLINE
ENDFUNCTION
FUNCTION setoutput: chip
INLINE
ConfigIOchipAsOutput (chip); // semicolon
ENDINLINE
ENDFUNCTION
FUNCTION output: chip, info
INLINE
IOoutput (chip,info); // semicolon
ENDINLINE
ENDFUNCTION
out put of the complier
_______________________________________
*** Configuration: WIN32 ***
precompiling...
GPC - GLBasic Precompiler V.2006.279 - 3D, NET
compiling...
k8000.gbas (1 KB)
Wordcount:10 commands
compiling:
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp: In function `int __GLBASIC__::__MainGameSub_()':
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp:22: error: expected primary-expression before "extern"
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp:22: error: expected `;' before "extern"
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp:23: error: expected primary-expression before "extern"
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp:23: error: expected `;' before "extern"
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp:24: error: expected primary-expression before "extern"
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp:24: error: expected `;' before "extern"
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp:25: error: expected primary-expression before "extern"
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp:25: error: expected `;' before "extern"
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp:26: error: `start_8000' undeclared (first use this function)
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp:26: error: (Each undeclared identifier is reported only once for each function it appears in.)
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp:27: error: `SelectI2CprinterPort' undeclared (first use this function)
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp:28: error: `ConfigIOchipAsOutput' undeclared (first use this function)
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp:29: error: `IOoutput' undeclared (first use this function)
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp: In function `DGInt __GLBASIC__::startup()':
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp:50: error: `start_8000' undeclared (first use this function)
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp:50: error: `IF' undeclared (first use this function)
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp:51: error: expected `;' before '{' token
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp:55: error: `ELSE' undeclared (first use this function)
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp:55: error: expected `;' before '{' token
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp: In function `DGInt __GLBASIC__::setltp(DGInt)':
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp:70: error: `SelectI2CprinterPort' undeclared (first use this function)
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp: In function `DGInt __GLBASIC__::setoutput(DGInt)':
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp:80: error: `ConfigIOchipAsOutput' undeclared (first use this function)
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp: In function `DGInt __GLBASIC__::output(DGInt, DGInt)':
C:\Program Files\GLBasic\Compiler\platform\gpc_temp0.cpp:90: error: `IOoutput' undeclared (first use this function)
linking:
success
_______________________________________
*** Finished ***
Time: 1.3 sec
Build: 1 succeeded, 0 failed