Search found 21 matches

by fenyctis
Sun Jul 02, 2006 1:28 pm
Forum: Coding Questions
Topic: Variable variables
Replies: 13
Views: 2770

srod wrote:How many clients are we talking about?
Never mind, even a thousand clients doesn't consume that much memory.
Say the strings are a max of 30: ((4+30+30)*1000)/1024 = 62kB

Thanks!
by fenyctis
Sun Jul 02, 2006 1:18 pm
Forum: Coding Questions
Topic: Variable variables
Replies: 13
Views: 2770

Assuming you're writing all this in Purebasic, then I wouldn't worry about databases. If I've understood correctly, then you could use SQLite easily enough - providing the server application is accessing it as if it were a stand alone app. SQLite simply requires that you copy a single .dll file ...
by fenyctis
Sun Jul 02, 2006 1:05 pm
Forum: Coding Questions
Topic: Variable variables
Replies: 13
Views: 2770

Yes, but unless I'm mistaken, mIRC is not a compiler.

The only way you'll be able to implement something along these lines, is before compilation, e.g. with a macro.

**EDIT - too slow! :D

The numbers are actually ClientIDs of connecting clients and I want to store some information they pass on ...
by fenyctis
Sun Jul 02, 2006 1:01 pm
Forum: Coding Questions
Topic: Variable variables
Replies: 13
Views: 2770

SunSatION wrote:Well, mIRC is not a compiler. That's the only reason why that's allowed. With mIRC scripting, variables are not stored in the data segment, but saved in an ini file :P
XD Good one.
by fenyctis
Sun Jul 02, 2006 1:00 pm
Forum: Coding Questions
Topic: Variable variables
Replies: 13
Views: 2770

I think you should us arrays in this case.


Dim var(1000)
varentry = 987
var(varentry) = test1

;Here is to show you that you can change the variable
varentry = 987-853 ; which is equal to 134
var(varentry) = test2


I also think that variable variables are not possible to create

The numbers ...
by fenyctis
Sun Jul 02, 2006 12:58 pm
Forum: Coding Questions
Topic: Variable variables
Replies: 13
Views: 2770

No chance! :?

Once a program is compiled, all variable names lose their meaning and translate to locations within the computers memory (the heap, the stack etc.)

The closest you'll get is to use an array or a linked list or perhaps even allocate some memory etc.

Of course, you could probably ...
by fenyctis
Sun Jul 02, 2006 12:48 pm
Forum: Coding Questions
Topic: Variable variables
Replies: 13
Views: 2770

Variable variables

Heh, like the topic title.

So what I'm looking for is how to have variable variables:

Code: Select all

var{variable} = test
As in:
var987 = test1
var134 = test2
As in: creating variables during the programme execution with variable names.

I realize this might be a little unclear..

~fenyctis
by fenyctis
Thu Mar 02, 2006 4:41 pm
Forum: Coding Questions
Topic: Simulating a mouseclick
Replies: 1
Views: 935

I found the answer myself after more searching.
Thanks a bundle anyway.

viewtopic.php?t=3942

mouse_event_(#MOUSEEVENTF_LEFTDOWN,0,0,0,0)
by fenyctis
Thu Mar 02, 2006 4:26 pm
Forum: Coding Questions
Topic: Simulating a mouseclick
Replies: 1
Views: 935

Simulating a mouseclick

I would like to simulate a mouseclick, on the position where the mouse is at that moment.
I've searched the forums, but couldn't find a solution.

~fenyctis
by fenyctis
Thu Sep 29, 2005 5:37 pm
Forum: Coding Questions
Topic: Total Items Array
Replies: 3
Views: 816

Hmm.. yes indeed. Thanks a bundle. I think it's a thing that could or should be included in future versions of PB. I think it's used lots of times.

Thanks a bunch mate.
by fenyctis
Thu Sep 29, 2005 5:26 pm
Forum: Coding Questions
Topic: Total Items Array
Replies: 3
Views: 816

Total Items Array

I've been searching the forums for a while now, but I can't find it... I just want to now how much items there are in an array. It's probably right under my nose, I know, rtfm and stuff.

fenyctis
by fenyctis
Tue Sep 27, 2005 4:45 pm
Forum: Coding Questions
Topic: Capturing mouse events
Replies: 7
Views: 1862

Okay.
--
Got it working, thanks a bundle.
by fenyctis
Tue Sep 27, 2005 4:44 pm
Forum: Coding Questions
Topic: Capturing mouse events
Replies: 7
Views: 1862

eid.l = WindowEvent()
If eid
If eid = #PB_Event_CLosewindow
quit = 1
EndIf
Else

If GetAsyncKeyState_(#VK_LBUTTON)
leftmousepressed = 1
Else
If leftmousepressed = 1
TriggerMouseReleaseAndBounceAround
leftmousepressed = 0
EndIf
EndIf

EndIf
by fenyctis
Tue Sep 27, 2005 4:36 pm
Forum: Coding Questions
Topic: Capturing mouse events
Replies: 7
Views: 1862

I seem to have got it to work now. Thanks a bundle. But now I've got a 50% usage of my program. Is this because of the GetAsyncKeyState? Is there a way to prevent this?
by fenyctis
Tue Sep 27, 2005 4:15 pm
Forum: Coding Questions
Topic: Capturing mouse events
Replies: 7
Views: 1862

Err.. yes. Sounds like that's wrong. :P Should I make a thread?