Antonio,

One of the OxygenBasic compiler forum member discovered a bug with
IupScanf and I suggested using the recommended IupGetParam function
instead. As it turns out, they both don't seem to work. Can you verify
on your end?

John

--------------------------------------------------

Quote: Charles Pegge (Oxygen Basic author)

Hi Roland, John,

Both IupScanf and IupGetParam appear to be dud. And I have checked that
the parameters were passed correctly.

*** OxygenBasic ***

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       

 
  IupOpen(null,null)


  'SCANF TEST
  ===========

  int result
  string sdat=nuls 300
  int    idat
  double fdat
  result = IupScanf("IupScanf Example\n Text:%300.5%s",strptr sdat,null)
  print sdat 


  '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,

     "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

  print pinteger
  IupClose()
 


------------------------------------------------------------------------------
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to