Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/overhertz/domains/codeziron.com/public_html/ziron/ziron.db.connector.php on line 13 code:zIRON - Get the latest releases plus source-codes and tutorials - Simplifed Assembly Programming Language.
Register | Login
Forum Index > Requests and Feedback > uncompleted parameter
Author Message
Pages: 1
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 638
Topics: 103

Location:
Alex, Egypt
[983] uncompleted parameter - posted: 2011-12-09 17:44:17

i was playing with some code and needed to use wsprintf function , found it commented in
user32.zir file header , declared like this
Code:
function  wsprintfA(pointer output; pointer format): int32; cdecl;


then i want to call it with more than 2 parameters , ziron did not allow that, so i made this
macro to call it with any numbers of arguments
Code:
inline function wsprintf(;) 
{
  $i = $argc;  
  $to = $argc - 2;
  $repeat $to:  
     push $arg[$i];
     $i--;
  $end;
  wsprintfA($arg[0], $arg[1]);
  // Correct the stack 'cdecl'
  $arg =  $to * 4;
  Esp += $arg;
  $return eax;
}


so it would be better if ziron allow uncompleted parameters.

another workaround is telling zrion to did not check for the amount of parameters just
push all arguments and call the function.


http://www.freewebs.com/ogremagic/index.htm
Admin
Site Admin

avatar

(send private message)

Posts: 925
Topics: 54

Location:
OverHertz Studio
[987] - posted: 2011-12-09 21:42:26
i have implemented this, but for now it is only accepted for imported functions, i will add support for internal functions for next release if i get time...

Code:
  function wsprintf = wsprintfA(char* output; char* format[]): Int32; cdecl;


sample:

Code:
char myBuf[512];

wsprintf(@myBuf, '%i + %i = %i', 1, 1, 2);

print('mybuf = ', @myBuf, '\r\n');


output:
Code:
1 + 1 = 2


i've updated the beta

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 638
Topics: 103

Location:
Alex, Egypt
[989] - posted: 2011-12-09 21:46:36

very nice , thank you Mr. Colin.

http://www.freewebs.com/ogremagic/index.htm
Pages: 1
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 2 user(s) online. 0 member(s) and 2 guest(s)
Most users ever online was 999, May 11, 2018, 9:01 am.


Statistics:
Threads: 223 | Posts: 1837 | Members: 50 | Active Members: 50
Welcome to our newest member, NobodyAtWork
const Copyright = '2011-2018 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd