'THESE DIALOGS DO NOT SHOW
includepath "$\inc\"
% filename "z.exe"
'include "RTL32.inc"
'include "console.inc"
'include "minwin.inc"
includepath "iup\"
extern lib "IUP/iup.dll" cdecl
include "iup.h"
extern cdecl
function ReplaceBN(char*fmt) as string
========================================
string s=fmt
do
i=instr(s,"\n")
if i then
s=left(s,i-1)+chr(10)+mid(s,i+2)
else
exit do
end if
end do
return s
end function
function main(sys argc,argv) as sys
===================================
IupOpen(null,null)
'IupSetLanguage("ENGLISH");
'SCANF TEST
===========
int ret;
int integer = 12;
float real = 1e-3f;
string text = "This is a vector of characters";
string fmt= _
"IupScanf Example\n"+
"Text: %300.5%s\n"+
"Real: %20.10%g\n"+
"Integer: %3.10%d\n"
fmt = replaceBN fmt
ret = IupScanf(fmt, text, &real, &integer);
if (ret == -1)
IupMessage("IupScanf","Operation canceled");
else
IupMessagef("IupScanf","Text: %s\nReal: %f\nInteger: %d\nFields read successfully: %d",text,real,integer,ret);
end if
'GETPARAM TEST
==============
int pboolean = 1;
int pinteger = 3456;
float preal = 3.543f;
int pinteger2 = 192;
float preal2 = 0.5f;
float pangle = 90;
char pstring[100] = "string text";
char pfont[100] = "Courier, 24";
char pcolor[100] = "255 0 128";
int plist = 2, poptions = 1;
char pstring2[200] = "second text\nsecond line";
char file_name[500] = "test.jpg";
sys param_action=0
'itr !
if not (IupGetParam("Title", param_action, 0,
replaceBN (
"Bt %u[, MyCancel, Help!]\n"+
"Boolean: %b[No,Yes]\n"+
"Integer: %i\n"+
"Real 1: %r\n"+
"Sep1 %t\n"+
"Integer: %i[0,255]\n"+
"Real 2: %r[-1.5,1.5,0.05]\n"+
"Sep2 %t\n"+
"Angle: %a[0,360]\n"+
"String: %s\n"+
"Options: %o|item0|item1|item2|\n" +
"List: %l|item0|item1|item2|item3|item4|item5|item6|\n" +
"File: %f[OPEN|*.bmp;*.jpg|CURRENT|NO|NO]\n"+
"Color: %c{Color Tip}\n"+
"Font: %n\n"+
"Sep3 %t\n"+
"Multiline: %m\n"),
&pboolean, &pinteger, &preal, &pinteger2, &preal2, &pangle, pstring,
&poptions, &plist, file_name, pcolor, pfont, pstring2, NULL))
end if
IupClose()
end function
main null,null