Author Topic: Syntax Checker & Gosub  (Read 12943 times)

0 Members and 1 Guest are viewing this topic.

Freddy

  • Guest
Syntax Checker & Gosub
« on: June 17, 2008, 08:47:18 PM »
0
Ok, so I have a script that I'm working on that is based off 2 skills. The menu allows a user to choose what skill they'd like to train and sets the #menures to a variable called %skill. The script moves on to the skill table to determine the best way to train for that character. From there, it hits the last gosub before entering a main loop.

To enter the main loop in my script, I use a gosub like this

gosub %skill ;from the menu set var

When I run the syntax checker, it says the sub is unused..which it is until the var is set...but will ScriptUO be able to have a gosub like that and will the syntax checker recognize  that?

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Syntax Checker & Gosub
« Reply #1 on: June 17, 2008, 09:05:51 PM »
0
Ok, so I have a script that I'm working on that is based off 2 skills. The menu allows a user to choose what skill they'd like to train and sets the #menures to a variable called %skill. The script moves on to the skill table to determine the best way to train for that character. From there, it hits the last gosub before entering a main loop.

To enter the main loop in my script, I use a gosub like this

gosub %skill ;from the menu set var

When I run the syntax checker, it says the sub is unused..which it is until the var is set...but will ScriptUO be able to have a gosub like that and will the syntax checker recognize  that?

Well not really because the syntax checker doesn't really know about runtime stuff which is the variable evaluation as it's determined at runtime.  The syntax checker in the current code is pretty much a pre-parser.

I'll be setting an option where you can ignore non-immediate expressions like "gosub %x".  That'll probably fix what you're thinking.

In the mean time, just consider it a warning since many people might not realize they have potentially improper syntax.  If it's intended, then bully for you!  ;)
« Last Edit: June 17, 2008, 09:10:38 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Freddy

  • Guest
Re: Syntax Checker & Gosub
« Reply #2 on: June 17, 2008, 09:10:21 PM »
0
lol

You gotta remember who I am...

I don't follow synatx, syntax follows me :D

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Syntax Checker & Gosub
« Reply #3 on: June 17, 2008, 09:12:45 PM »
0
lol

You gotta remember who I am...

I don't follow synatx, syntax follows me :D

Lol, well now you have Sister Mary Ethyl, the meter-stick wielding nun who will wrap your knuckles hard when you make a syntax error. 

(yes, a character from my 1st grade life.)
Please read the ScriptUO site RULES
Come play RIFT with me!

Freddy

  • Guest
Re: Syntax Checker & Gosub
« Reply #4 on: June 17, 2008, 09:31:10 PM »
0
lmao.

well..hmmm

maybe I better start following proper syntax :P

Nah...i'll risk it :D

by the way.. i really did lmao

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Syntax Checker & Gosub
« Reply #5 on: June 17, 2008, 09:59:16 PM »
0
lmao.

well..hmmm

maybe I better start following proper syntax :P

Nah...i'll risk it :D

by the way.. i really did lmao

Heh, well she does bring back memories of horror.  I did much better in the non-conformity of public schools.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Mystre

  • Newbie
  • *
  • Posts: 6
  • Activity:
    0%
  • Reputation Power: 0
  • Mystre has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: Syntax Checker & Gosub
« Reply #6 on: September 28, 2008, 06:13:26 PM »
0
FYI : I love the syntax checker :P

Offline Xclio

  • Officially "The MAN"
  • Elite
  • *
  • *
  • Posts: 981
  • Activity:
    0%
  • Reputation Power: 9
  • Xclio has no influence.
  • Gender: Male
  • Respect: +56
  • Referrals: 1
    • View Profile
Re: Syntax Checker & Gosub
« Reply #7 on: September 28, 2008, 07:54:57 PM »
0
I agree, the syntax checker rocks.  That along with the color coding make it light years beyond EUO!

Tags: