SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 28/02/2014, 06:03 PM   #11
SkittlesAreFalling
Big Clucker
 
Join Date: Oct 2013
Posts: 155
Reputation: 14
Default Re: Inline file loading

How would you save to the file?
Normal file functions or are you planning on making a similar inline macro?
SkittlesAreFalling is offline   Reply With Quote
Old 28/02/2014, 06:10 PM   #12
Emmet_
Guest
 
Posts: n/a
Default Re: Inline file loading

Quote:
Originally Posted by SkittlesAreFalling View Post
How would you save to the file?
Normal file functions or are you planning on making a similar inline macro?
Normal file functions, for now. I suppose I can develop a syntax such as:

pawn Code:
new
    value,
    Float:fValue,
    str[32];

append File("file.ini", "Field", value, "Float", fValue, "String", str)
{
    print("File saved!");
}

But that's what y_ini is designed to do. This is designed to work with INI files and special syntax files (e.g. "files|like|this").
  Reply With Quote
Old 28/02/2014, 06:24 PM   #13
SkittlesAreFalling
Big Clucker
 
Join Date: Oct 2013
Posts: 155
Reputation: 14
Default Re: Inline file loading

Okay.
I think it'll be a good idea to make an append, really helpful for lazy people! lol

Great work man.

Edit:
Looking over your function, I believe I can make the append for you if you want.
SkittlesAreFalling is offline   Reply With Quote
Old 28/02/2014, 06:25 PM   #14
Scaleta
Big Clucker
 
Join Date: May 2013
Posts: 87
Reputation: 29
Default Re: Inline file loading

Don't you mean eInline File Loading? Jokes.

This could be useful for small things like quick config files. Awesome!
__________________
Developer at Next Generation Gaming
Scaleta is offline   Reply With Quote
Old 28/02/2014, 06:35 PM   #15
Ada32
Huge Clucker
 
Ada32's Avatar
 
Join Date: Apr 2013
Posts: 293
Reputation: 62
Default Re: Inline file loading

don't just have an idea and implement so loosely.. the concept itself is bad. and why is import a keyword?
Ada32 is offline   Reply With Quote
Old 28/02/2014, 06:53 PM   #16
Emmet_
Guest
 
Posts: n/a
Default Re: Inline file loading

Quote:
Originally Posted by SkittlesAreFalling View Post
Okay.
I think it'll be a good idea to make an append, really helpful for lazy people! lol

Great work man.

Edit:
Looking over your function, I believe I can make the append for you if you want.
Sure thing, but it might be a bit complicated (e.g. it might require a few assembly instructions).

Quote:
Originally Posted by Scaleta View Post
Don't you mean eInline File Loading? Jokes.

This could be useful for small things like quick config files. Awesome!
Haha, thanks! I was thinking of adding the "e" in there, like I did with my previous libraries

Quote:
Originally Posted by Ada32 View Post
don't just have an idea and implement so loosely.. the concept itself is bad. and why is import a keyword?
I've actually been working on the idea for a while. At first it was a global keyword:

pawn Code:
#include <a_samp>

new
    a,
    Float:b,
    c[24];

fload LoadFile["test.ini"](a, Float:b, c[24]);

public OnFilterScriptInit()
{
    return 1;
}

But it just looked too tacky. I resorted to creating an inline "keyword" so it can all be controlled in a single compound block. I chose "import" because it was the only appropriate word for it (think of it as a way.. "importing" a file and read the data). Some other previous keywords were "Load_File", "File_Load" and "loadfile" but they all looked weird.
  Reply With Quote
Old 28/02/2014, 07:41 PM   #17
CriticalRP
Little Clucker
 
Join Date: Apr 2013
Posts: 38
Reputation: -7
Default Re: Inline file loading

Quote:
Originally Posted by Emmet_ View Post
Works fine for me, what code are you trying to use?
I'm using your code. The one with test.ini
CriticalRP is offline   Reply With Quote
Old 01/03/2014, 12:31 AM   #18
Emmet_
Guest
 
Posts: n/a
Default Re: Inline file loading

Quote:
Originally Posted by CriticalRP View Post
I'm using your code. The one with test.ini
I've updated the link, try now.

I also need to know which OS you're running.

Code:
Updates:
- The delimiter parser now detects the sscanf2 plugin and uses it accordingly!
- Fixed a few minor bugs with the parser.
  Reply With Quote
Old 01/03/2014, 04:12 PM   #19
CriticalRP
Little Clucker
 
Join Date: Apr 2013
Posts: 38
Reputation: -7
Default Re: Inline file loading

Quote:
Originally Posted by Emmet_ View Post
I've updated the link, try now.

I also need to know which OS you're running.

Code:
Updates:
- The delimiter parser now detects the sscanf2 plugin and uses it accordingly!
- Fixed a few minor bugs with the parser.
Windows 7 Home Premium 64bit
CriticalRP is offline   Reply With Quote
Old 02/03/2014, 09:35 AM   #20
fiki574
Gangsta
 
fiki574's Avatar
 
Join Date: Mar 2011
Location: Croatia
Posts: 856
Reputation: 169
Default Re: Inline file loading

Jesus Christ, this is sick! Awesome work.
__________________
fiki574 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading File ? park4bmx Scripting Help 3 13/04/2012 10:55 AM
Loading the next file. milanosie Scripting Help 3 27/01/2012 05:23 PM
Loading Something From A File Tommy_Mandaz Help Archive 10 30/06/2011 04:07 PM
Re-loading a file? Skylar Paul Help Archive 1 29/05/2011 05:37 AM
File Loading (Jeff) Help Archive 1 21/10/2009 01:58 PM


All times are GMT. The time now is 02:49 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.