Author Topic: GetID, SetID syntax in if statement?  (Read 3910 times)

0 Members and 1 Guest are viewing this topic.

Offline Barticus

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
GetID, SetID syntax in if statement?
« on: 19 October, 2005, 23:55:09 »
local FrameID = getglobal("FR_TargetFrame1"):GetID()
if FrameID=="Off" then
...

I've tried every combination of things to get this condition to fire, and it won't.  So I'm thinking either the ID of the frame cannot be stored as a variable to be tested against, or I just don't know the proper syntax for calling it up.  This is very central to my script, so I'm really hoping there's a method for making this work.

Thanks in advance,

Barticus

PtokaX forum

GetID, SetID syntax in if statement?
« on: 19 October, 2005, 23:55:09 »

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 752
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
(No subject)
« Reply #1 on: 20 October, 2005, 00:05:43 »
getglobal("FR_TargetFrame1")

What is this?
« Last Edit: 20 October, 2005, 00:10:46 by bastya_elvtars »
Everything could have been anything else and it would have just as much meaning.

Offline Barticus

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
(No subject)
« Reply #2 on: 20 October, 2005, 00:10:16 »
Quote
Originally posted by bastya_elvtars
getglobal("FR_TargetFrame1")

What is this? getglobal is only for the C API, it has no use in LUA, also slows it down. (If we think the same...)

it refers to an XML document, and works perfectly in every other facet of my script.

I'm working on a mod for World of Warcraft.

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 752
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
(No subject)
« Reply #3 on: 20 October, 2005, 00:16:24 »
local FrameID = getglobal("FR_TargetFrame1"):GetID()

Either the function call is wrong, or the return value is nil. Is
Code: [Select]
print(type(getglobal("FR_TargetFrame1"))) outputting "table"?
« Last Edit: 20 October, 2005, 00:16:47 by bastya_elvtars »
Everything could have been anything else and it would have just as much meaning.

Offline Barticus

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
(No subject)
« Reply #4 on: 20 October, 2005, 00:28:43 »
heh, apparantly "GetID" only works in a conditional as an integer.

Got 'er fixed, but I thank you for your attention.

PtokaX forum

(No subject)
« Reply #4 on: 20 October, 2005, 00:28:43 »