10.THE LIBRARIES
A Programming Language Manual




You learned how to create functions that perform some specific tasks in your programs and even to group them in separate files. To come to your aid, the GS9 language offers a few sets of predefined functions, grouped in so called libraries. They have different uses, from working with strings, to mathematical functions and even to files access. The console application makes these libraries accessible so all these functions are ready to be used anywhere you need them. Let's have a look at the GS9 libraries.


10.1 Default library

The Default library contains common functions that are used in most programs. In fact, the println instruction from all of your programs, is a function declared in this default library.

print, println,
scanln,
getch,
tabsize, tabresize, tabdel, tabins, tabadd, strempty, strlen, strpos, strchr, strskip, strlwr, strupr, strsub, strtrim, strexplode, strimplode,
gs_time,
gs_systemtime,
gs_systemdate, gs_rand, gs_frand, gs_srand,
gs_gid, gs_fid, gs_gidname, gs_fidname,
gs_compilefile, gs_compilestring, gs_dofile, gs_dostring,
gs_error, gs_debug



10.2 Math library

The Math library contains mathematical functions. Some of them can be used with both integer and float numbers.

gs_sgn, gs_abs,
gs_floor, gs_ceil, gs_round, gs_trunc,
gs_exp, gs_log, gs_pow, gs_sqrt,
gs_sin, gs_cos, gs_tan, gs_asin, gs_acos, gs_atan,
PI, PI2, DEG2RAD, RAD2DEG,



10.3 File library

The File library contains functions to work with files. It can load and save data from files, create directories, etc.

gs_fileopen, gs_fileseek, gs_filetell,
gs_filewriteint, gs_filewritefloat, gs_filewritetext, gs_filewritedata,
gs_filereadint, gs_filereadfloat, gs_filereadtext, gs_filereaddata,
gs_fileclose,
gs_fileinfo, gs_filedelete, gs_filefind,
gs_directoryget, gs_directoryset, gs_directorycreate, gs_directorydelete,
gs_inigetint, gs_inigetstr, gs_inisetint, gs_inisetstr



10.4 Win library

The Win library contains Windows specific functions. Like functions to launch executable files or to pop message boxes.

gs_shell, gs_launch, gs_commandline,
gs_messagebox, gs_messagebeep,
MB_OK, MB_OKCANCEL, MB_RETRYCANCEL, MB_YESNO, MB_YESNOCANCEL, MB_ABORTRETRYIGNORE, MB_ICONEXCLAMATION, MB_ICONQUESTION, MB_ICONERROR, MB_SYSTEMMODAL,
IDOK, IDCANCEL, IDYES, IDNO, IDABORT, IDRETRY, IDIGNORE,