| 04-04-2017, 02:33 PM | #1 |
this is a part of zinc library. error in the text "Preload("\");" Thanks for answering my question. 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 |
| 04-04-2017, 11:36 PM | #2 |
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 | |
Quote:
I try to write that JASS:
Preload("\\");
SetPlayerTechMaxAllowed(Player(12),0,"+I2S(dcount)+")//");
Preload("\\") ;
return//") ;
but i write by vjass that JASS:
call Preload("\")
call SetPlayerTechMaxAllowed(Player(13,0,"+I2S(dcount)+")//")
call Preload("\")
return//")
So i don't understand why zinc syntax error. |
| 04-19-2017, 06:09 PM | #4 |
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. |
