GetScriptLine() or something?
#8

Quote:
Originally Posted by RyDeR`
Посмотреть сообщение
As far as I understood, you want to store all data you read from line 'x'?
Possible. Even very simple.
No, not read or execute or store a specific line or anything like that. But get the actual line number of the script where this function is.
Like so:
pawn Код:
//Start of the file, Line 1.
main () //Line 2
{ // Line 3
// Line 4
} // Line 5
// Line 6
PrintCurrentLine() // Line 7
{ // Line 8
    return printf("Current Line: %i", GetScriptLine()); //Line 9, prints to console: "Current Line: 9"
} // Line 10

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
It's impossible. Nothing else.
You 100% sure? It is possible, that it's impossible (lol), but it's also possible that there might just be a way, just noone really uses it, so a few know about it.

If there is such a thing it is probably not a function, but some kind of instruction for compiler.
There is a Directive "#line" available. But this is what the wiki says about it:
Код:
#line

This is another mostly useless directive like #file. It just specifies the current line number if you feel the need to change it.
And that is not really it. But it's kinda close...
Reply


Messages In This Thread
GetScriptLine() or something? - by TheXIII - 24.11.2010, 14:39
Re: GetScriptLine() or something? - by WillyP - 24.11.2010, 14:43
Re: GetScriptLine() or something? - by TheXIII - 24.11.2010, 14:50
Re: GetScriptLine() or something? - by WillyP - 24.11.2010, 14:53
Re: GetScriptLine() or something? - by Jochemd - 24.11.2010, 14:54
Re: GetScriptLine() or something? - by RyDeR` - 24.11.2010, 14:56
Re: GetScriptLine() or something? - by Hiddos - 24.11.2010, 14:59
Re: GetScriptLine() or something? - by TheXIII - 24.11.2010, 15:05
Re: GetScriptLine() or something? - by RyDeR` - 24.11.2010, 15:10
Re: GetScriptLine() or something? - by TheXIII - 24.11.2010, 15:18

Forum Jump:


Users browsing this thread: 1 Guest(s)