Search found 34 matches

by Mahan
Sat Sep 11, 2010 10:13 am
Forum: Coding Questions
Topic: EXE edit like a trojan
Replies: 19
Views: 3731

Re: EXE edit like a trojan

On Windows if you start processes from an .exe the .exe-file is locked/read-only until you close the last process started from it.
This makes it very hard for a .exe to modify itself.

One trick that you can do however (I've done it on a Delphi program a long time ago) is that you can have a DLL ...
by Mahan
Fri Mar 12, 2010 12:20 pm
Forum: Coding Questions
Topic: Wrap C++ in purebasic and render quads questions
Replies: 3
Views: 1077

Re: Wrap C++ in purebasic and render quads questions

If this isn't a ad bot...

@Rook: I found this quote quite fun because of the fact that you're the only one in this thread providing a link to a pay-site. :D (hint: It's in you sig. )

how am I an ad bot? thats just insulting, I'll take my custom elsewhere[...]

@hippocoder: Afaik, Rook is not ...
by Mahan
Wed Mar 10, 2010 7:44 pm
Forum: Coding Questions
Topic: Does Purebasic have an equivalent to the "CHAIN" statement
Replies: 20
Views: 4556

Re: Does Purebasic have an equivalent to the "CHAIN" statement

[...]the world of GUI applications development based upon the client-server model.

Just a comment on this: C/S-model is starting to get a bit dated now. This technique was popular around 95-00 IIRC. I'm actually in the process of modernizing a C/S business application to become more n-tier based ...
by Mahan
Wed Mar 10, 2010 3:22 pm
Forum: Coding Questions
Topic: Does Purebasic have an equivalent to the "CHAIN" statement
Replies: 20
Views: 4556

Re: Does Purebasic have an equivalent to the "CHAIN" statement

What I think about when you mention the main-menu and then chaining in other program parts while still having some (global?) variables accessible is very similar to schemes I've used while back in the 80s and early 90s.

The general idea to modularize the code is very good, but you might need to ...
by Mahan
Tue Mar 09, 2010 8:31 am
Forum: Coding Questions
Topic: SQlite: Qurey within Query
Replies: 6
Views: 1646

Re: SQlite: Qurey within Query

I'm not sure if this applies here (since i don't know the DB layout) but if this is a single database you might be able to write just one select-statement that includes a join between the two tables. Google "sql join" for details.

If a join is possible you'll probably get much faster and better ...
by Mahan
Mon Mar 08, 2010 2:54 pm
Forum: Coding Questions
Topic: Background running procedure
Replies: 26
Views: 3831

Re: Background running procedure

Hmm, SetGadgetText() from within a thread, is that really ok?

Unless SetGadgetText() does some kind of synchronization in the background this looks pretty dangerous to me. (Long ago I did the equivalent of this in Delphi which resulted in random program crashes.)
by Mahan
Sat Mar 06, 2010 1:23 am
Forum: Game Programming
Topic: Gadget3D (like) for 2DDrawing?
Replies: 3
Views: 2507

Re: Gadget3D (like) for 2DDrawing?

Thank you very much, this is what I was looking for.

With "Interactive Windows" I meant a GUI-system that can be part of a game-loop with the GUI drawn over game graphics while the game is running. (probably not the right name for it, though). After checking, Sgx seems to do this, which is nice.
by Mahan
Fri Mar 05, 2010 9:49 am
Forum: Game Programming
Topic: Gadget3D (like) for 2DDrawing?
Replies: 3
Views: 2507

Gadget3D (like) for 2DDrawing?

Hi everyone,

Is there anything similar to Gadget3D but that works in a 2DDrawing context?
Have anyone written or published any Gadget/Widget/Graphical GUI for the 2DDrawing subsystem of PB?

I'm talking about a lib with the ability to create interactive windows, panels, buttons, checkboxes ...
by Mahan
Mon Mar 01, 2010 10:47 am
Forum: Coding Questions
Topic: opening same file twice
Replies: 11
Views: 2425

Re: opening same file twice

I seem to remember the reason why SQLite has to lock the entire file is that there are OSes where you cannot reliably open a file twice for writing with reliable block-locking. I think this was mainly a Linux issue. And since PB is for Linux too this might be the reason for the limitation?
by Mahan
Fri Feb 19, 2010 10:42 am
Forum: Off Topic
Topic: New to PureBasic
Replies: 9
Views: 2336

Re: New to PureBasic

You should look at autoit or autohotkey for windows/browser automation.

I like PB alot but in this case the above tools are better for the job that need to be done.
by Mahan
Thu May 14, 2009 11:16 pm
Forum: Coding Questions
Topic: For/Next Loop with Step doesn't excute properly
Replies: 19
Views: 2786


Top Controlled, next step at the end....

executed at least once.


Agree 100%. That's what I meant when I wrote:


... a while..wend type loop are very easy to rig for 1 single forced run-through ...


In the end it's clearly a matter of tastes (as some already noted), but it's easy to adapt ...
by Mahan
Thu May 14, 2009 10:21 pm
Forum: Coding Questions
Topic: Assistance
Replies: 4
Views: 1708

I'll suggest this workflow if you want to solve this problem:

1. Google for your modems user manual. Initialization-strings syntax might differ between modem-brands. It's many years since i used modems, but I think the init-string "AT&CID=1" was enabling the called id on one modem that I once owned ...
by Mahan
Thu May 14, 2009 10:00 pm
Forum: Coding Questions
Topic: Free memory from a string used in a structure?
Replies: 13
Views: 4633

A newbie PB question:

This only applies when allocating and managing structure-memory manually, right?

If I use structures with Strings in normal Lists (where the memory allocation is managed by PB), PB will surely handle the releasing of the internal strings when i do DeleteElement, correct?
by Mahan
Thu May 14, 2009 9:47 pm
Forum: Coding Questions
Topic: For/Next Loop with Step doesn't excute properly
Replies: 19
Views: 2786

Even though I'm a fairly new PureBasic user I must give my support for the current behavior.

I've programmed an awful amount of languages and scripts and this is by far the most common behavior i.e:


for a = b to c step d

equals (when incremental):

a=b ; initial state
while a <= c ; check if ...
by Mahan
Mon May 04, 2009 11:47 am
Forum: Coding Questions
Topic: How to programmatically set IP address, netmask and DNS, etc
Replies: 1
Views: 860

I think you will find a good starting point here.