| View previous topic :: View next topic |
| Author |
Message |
coder sal Master Cheater
Reputation: 0
Joined: 11 May 2007 Posts: 304
|
Posted: Tue May 13, 2008 6:30 pm Post subject: Problem Solved |
|
|
If scanflash.GetVariable(List1.Text) = True Then
------------------------------------^
?????????????????????????????????????
I'm trying to make a variable scanner but how would I do the code so it does the getvariable method to each column on the listbox, not like a whole text. IDK what to put in :/
Last edited by coder sal on Fri May 16, 2008 10:18 am; edited 1 time in total |
|
| Back to top |
|
 |
92Garfield I'm a spammer
Reputation: 57
Joined: 20 Dec 2007 Posts: 5871 Location: Banana Republic Germany
|
Posted: Tue May 13, 2008 6:56 pm Post subject: |
|
|
i dont know how to make it use a list but ingeneral it would be
| Code: | on error resume next
anything = flash.getvariable("variable") |
but then it would just say nothing if variable does not exist you would have to make on error goto..
_________________
|
|
| Back to top |
|
 |
coder sal Master Cheater
Reputation: 0
Joined: 11 May 2007 Posts: 304
|
Posted: Tue May 13, 2008 6:57 pm Post subject: |
|
|
| 92Garfield wrote: | i dont know how to make it use a list but ingeneral it would be
| Code: | on error resume next
anything = flash.getvariable("variable") |
but then it would just say nothing if variable does not exist you would have to make on error goto.. |
No Shit Sherlock =.=
That's a simple GetVariable method. I'm saying if it's a list, if you don't know that then just don't answer.
Sorry for replying so rude, it's just that you stated the obvious.
|
|
| Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Wed May 14, 2008 12:28 am Post subject: |
|
|
I would do something like this, in Delphi.
Make a global var, called i as integer and then make a timer, with this in.
| Code: | Flash.GetVariable(list1.Items.Strings[i]);
i := i + 1; |
I bet there's a better and easier way.
And remember to set i as 0, in FormCreate.
Last edited by NothingToShow on Wed May 14, 2008 12:29 am; edited 1 time in total |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Wed May 14, 2008 12:29 am Post subject: |
|
|
Use List1.List(List1.ListIndex) to get the selected items text.
_________________
- Retired. |
|
| Back to top |
|
 |
Estx Expert Cheater
Reputation: 0
Joined: 04 Mar 2008 Posts: 172
|
Posted: Wed May 14, 2008 12:52 am Post subject: |
|
|
Example:
| Code: | Dim i As Integer
For i = 0 To List1.ListCount - 1
If scanFlash.GetVariable(List1.List(i)) <> Nothing Then
Call myFunc() ' or set a variable, then exit for
End If
Next i |
I haven't programmed with the SWFlash so I'm not sure what GetVariable returns when calling a false reference. Just replace 'Nothing' with whatever is needed.
|
|
| Back to top |
|
 |
Anden100 Grandmaster Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 668
|
Posted: Wed May 14, 2008 5:00 am Post subject: |
|
|
| Moller wrote: | I would do something like this, in Delphi.
Make a global var, called i as integer and then make a timer, with this in.
| Code: | Flash.GetVariable(list1.Items.Strings[i]);
i := i + 1; |
I bet there's a better and easier way.
And remember to set i as 0, in FormCreate. |
Why would you need a timer for that? im not sure, but i think this would work:
| Code: |
for i:= 0 to 99 do
Flash.GetVariable(list1.Items.Strings[i]); |
that would do it 99 times O.o
|
|
| Back to top |
|
 |
Estx Expert Cheater
Reputation: 0
Joined: 04 Mar 2008 Posts: 172
|
Posted: Wed May 14, 2008 5:50 am Post subject: |
|
|
| Anden100 wrote: | | Moller wrote: | I would do something like this, in Delphi.
Make a global var, called i as integer and then make a timer, with this in.
| Code: | Flash.GetVariable(list1.Items.Strings[i]);
i := i + 1; |
I bet there's a better and easier way.
And remember to set i as 0, in FormCreate. |
Why would you need a timer for that? im not sure, but i think this would work:
| Code: |
for i:= 0 to 99 do
Flash.GetVariable(list1.Items.Strings[i]); |
that would do it 99 times O.o |
Lol 100 times, you forgot to include the initial index: 0.
|
|
| Back to top |
|
 |
Anden100 Grandmaster Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 668
|
Posted: Wed May 14, 2008 7:46 am Post subject: |
|
|
| Estx wrote: | | Anden100 wrote: | | Moller wrote: | I would do something like this, in Delphi.
Make a global var, called i as integer and then make a timer, with this in.
| Code: | Flash.GetVariable(list1.Items.Strings[i]);
i := i + 1; |
I bet there's a better and easier way.
And remember to set i as 0, in FormCreate. |
Why would you need a timer for that? im not sure, but i think this would work:
| Code: |
for i:= 0 to 99 do
Flash.GetVariable(list1.Items.Strings[i]); |
that would do it 99 times O.o |
Lol 100 times, you forgot to include the initial index: 0. |
wth! i can tell you, it aint the first time i do it O.o, i once fcked up an app, and i just couldnt figure out what was rong!
|
|
| Back to top |
|
 |
coder sal Master Cheater
Reputation: 0
Joined: 11 May 2007 Posts: 304
|
Posted: Fri May 16, 2008 7:31 am Post subject: |
|
|
The problem is still there, please try to observe it:
http://www.speedyshare.com/283750774.html
When I start scanning instead of functioning to if the variable is correct in the shockwaveflash control it functions to the listbox, if theres something in the list or not. Please help :/
|
|
| Back to top |
|
 |
Estx Expert Cheater
Reputation: 0
Joined: 04 Mar 2008 Posts: 172
|
Posted: Fri May 16, 2008 9:21 am Post subject: |
|
|
| Code: | Private Sub Timer2_Timer()
On Error Resume Next
Dim i As Integer
For i = 0 To List1.ListCount - 1
If scanflash.GetVariable(List1.List(i)) <> "" Then
MsgBox "ok"
Timer2.Enabled = False
End If
Next i
End Sub |
The loop was suggested for a command outside a timer.
If you're going to use a timer for this then add this to the top of mainvarscanform's code:
| Code: | | Private iPos As Integer |
Then replace your old Timer2 code with the following:
| Code: | Private Sub Timer2_Timer()
If iPos > List1.ListCount Then
iPos = 0
Timer2.Enabled = False
End If
On Error GoTo SkipCheck
If scanflash.GetVariable(List1.List(iPos)) <> "" Then
MsgBox List1.List(iPos) & " is a valid variable"
'Uncomment the lines below if you want to stop the timer once you've found a variable
'iPos = 0 ' Remember to reset the value when you want to start scanning from the start again
'Timer2.Enabled = False
End If
SkipCheck:
'If Err.Number = -2147467259 Then MsgBox List1.List(iPos) & " returned an error."
iPos = iPos + 1
End Sub |
I wont comment about the rest of your code, there's a lot that should be optimized in that - but you'll learn as you code more.
|
|
| Back to top |
|
 |
coder sal Master Cheater
Reputation: 0
Joined: 11 May 2007 Posts: 304
|
Posted: Fri May 16, 2008 9:28 am Post subject: |
|
|
| Estx wrote: | | Code: | Private Sub Timer2_Timer()
On Error Resume Next
Dim i As Integer
For i = 0 To List1.ListCount - 1
If scanflash.GetVariable(List1.List(i)) <> "" Then
MsgBox "ok"
Timer2.Enabled = False
End If
Next i
End Sub |
The loop was suggested for a command outside a timer.
If you're going to use a timer for this then add this to the top of mainvarscanform's code:
| Code: | | Private iPos As Integer |
Then replace your old Timer2 code with the following:
| Code: | Private Sub Timer2_Timer()
If iPos > List1.ListCount Then
iPos = 0
Timer2.Enabled = False
End If
On Error GoTo SkipCheck
If scanflash.GetVariable(List1.List(iPos)) <> "" Then
MsgBox List1.List(iPos) & " is a valid variable"
'Uncomment the lines below if you want to stop the timer once you've found a variable
'iPos = 0 ' Remember to reset the value when you want to start scanning from the start again
'Timer2.Enabled = False
End If
SkipCheck:
'If Err.Number = -2147467259 Then MsgBox List1.List(iPos) & " returned an error."
iPos = iPos + 1
End Sub |
I wont comment about the rest of your code, there's a lot that should be optimized in that - but you'll learn as you code more. |
Wow thanks alot. You are so in the credits
Also I'm +repping you once I get the chance.
Edit: Here's the program.
|
|
| Back to top |
|
 |
|