HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

A zinc error

04-04-2017, 02:33 PM#1
yeeboys
this is a part of zinc library. error in the text "Preload("\");"
Thanks for answering my question.
Collapse JASS:

//! zinc
library SLLib{

private function SyncInteger( gamecache gcache,integer mainkey,integer childkey,integer digit )
    string mkstr = I2S(mainkey);
    string ckstr = I2S(childkey);
    integer origin = GetStoredInteger(gcache, mkstr , ckstr );

    StoreInteger(gcache , mkstr , ckstr, digit);
    SyncStoredInteger(gcache , mkstr , ckstr );
    StoreInteger(gcache , mkstr ,ckstr , origin);



function SaveFile(string filename,gamecache gcache)
     integer mainkey;
     integer dcount;
     integer dindex;
     integer origin;
     mainkey = GetPlayerId(GetLocalPlayer())+1 ;
     dcount = GetStoredInteger(gcache,I2S(mainkey) ,"0");
     PreloadGenClear();
     PreloadGenStart();
     Preload("\");
     SetPlayerTechMaxAllowed(Player(12),0,"+I2S(dcount)+")//");
     
     Preload("\")  ;
    return//") ;
     PreloadGenEnd(filename);



}
//! endzinc

Attached Images
File type: jpgzinc error.jpg (97.5 KB)
04-04-2017, 11:36 PM#2
Fledermaus
I think it needs to be a double slash \\. \" is how you use a quote mark inside a string so that string from the preload is never actually being closed until part way through the next line - take a look at the syntax highlighting in your post.

Also the quotes in that SetPlayerTechMaxAllowed(Player(12),0,"+I2S(dcount)+")//"); line just look wrong in general.

Edit: I guess you're trying to do the preloader trick? What exactly are you trying to write to the file with it?
I still think the issue is with the quotes in general.
04-14-2017, 04:56 AM#3
yeeboys
Quote:
Originally Posted by Fledermaus
I think it needs to be a double slash \\. \" is how you use a quote mark inside a string so that string from the preload is never actually being closed until part way through the next line - take a look at the syntax highlighting in your post.

Also the quotes in that SetPlayerTechMaxAllowed(Player(12),0,"+I2S(dcount)+")//"); line just look wrong in general.

Edit: I guess you're trying to do the preloader trick? What exactly are you trying to write to the file with it?
I still think the issue is with the quotes in general.

I try to write that
Collapse JASS:
    
     Preload("\\");
     SetPlayerTechMaxAllowed(Player(12),0,"+I2S(dcount)+")//");
     Preload("\\")  ;
    return//") ;
also sent error at Preload("\\");

but i write by vjass that
Collapse JASS:
    call Preload("\")
    call SetPlayerTechMaxAllowed(Player(13,0,"+I2S(dcount)+")//")
    call Preload("\")
    return//")
is right.

So i don't understand why zinc syntax error.
04-19-2017, 06:09 PM#4
Anitarf
This was my experience as well, I could get the trick to work in vJass but not in zinc. I guess it's a problem with the zinc compiler, it doesn't let you do all the tricks that the vJass compiler does. In the end, I just wrote my library in vJass instead of zinc, they are cross-compatible anyway.