Search found 97 matches

by jqn
Mon Nov 13, 2006 10:17 am
Forum: Tricks 'n' Tips
Topic: Structures "on-the-fly"
Replies: 4
Views: 2196

Structures "on-the-fly"

Hi,
I dont know if this subject subject has been treated before. But if it serves for somebody:


Structure mystruc
mylong.l
mystring.s
...
Endstructure


*struc.mystruc = Allocatememory(sizeof(mystruc))
*struc\mylong = sizeof(mystruc)
*struc\mystring = "Loaded dato on the string ...
by jqn
Mon Nov 06, 2006 2:28 pm
Forum: Coding Questions
Topic: Thread and dll problem
Replies: 13
Views: 4295

the number of threads is dynamic.


in this case you can use a macro for create the structure, like this:


macro create_struc(trheadid)
Global my#threadid#data.mystruc
callfuctionfast(dlladdr, @my#threadid#data)
endmacro
(I'm not tested it with structures, but I'm use it with strings and ...
by jqn
Mon Nov 06, 2006 2:09 pm
Forum: Coding Questions
Topic: Thread and dll problem
Replies: 13
Views: 4295

Hi, my approach:

1.In every thread:

structure mystruc
mystring.s
endstructure

Global my{threadname}data.mystruc
....
callfuctionfast(dlladdr, @my{threadname}data)


2. In your DLL

structure mystruc
mystring.s
endstructure

ProcedureDLL Uppercase(*pointer)
*pointer\mystring=Ucase(*pointer ...
by jqn
Fri Nov 03, 2006 1:49 pm
Forum: Coding Questions
Topic: How to know the DIM of a array?
Replies: 13
Views: 2881

I think I've solved.
Use this code after your "mysql_fetch_row()" statement:

nf = 0
ini = peekl(*row)
debug str(ini)
lon=0
Repeat
new.l=peekl(*row+(nf*4))
if new = ini+lon
debug str(nf)+" : "+ *row\field[nf]
lon + len(*row\field[nf]) + 1
nf + 1
else
break
endif
forever

It checks if ...
by jqn
Fri Nov 03, 2006 12:32 pm
Forum: Coding Questions
Topic: How to know the DIM of a array?
Replies: 13
Views: 2881

it can parse for rows and fields without any count-like function.

You're using "field_count.l", a subfield from MYSQL_RES structure. My problem with it is similar to use "mysql_num_fields()" when I query to DB in a previous program: I need to send it to DLL.

In the DLL I've only the *row pointer ...
by jqn
Fri Nov 03, 2006 9:21 am
Forum: Coding Questions
Topic: How to know the DIM of a array?
Replies: 13
Views: 2881

I've tried it.
It produces a windows system error when it reach the end (out of memory, I suppose). I dont have a chance for testing the end+1 element.
by jqn
Fri Nov 03, 2006 9:01 am
Forum: Coding Questions
Topic: How to know the DIM of a array?
Replies: 13
Views: 2881

I know mysql_num_fields(), and I use it.

But I need to use the fields array in a DLL who can't connect to DB.
Of course, I can send num_fields as a parameter to DLL, but I would to avoid it because the DLL is used in a lot of processes.

If there is no another solution….
by jqn
Thu Nov 02, 2006 5:44 pm
Forum: Coding Questions
Topic: How to know the DIM of a array?
Replies: 13
Views: 2881

Thanks, Flype.
Unfortunately, my program source is mySQL.
It returns a *row pointer to an C-array (1 based).

I've tried your trick, but it seems that it dont work.
by jqn
Thu Nov 02, 2006 4:47 pm
Forum: Coding Questions
Topic: How to know the DIM of a array?
Replies: 13
Views: 2881

How to know the DIM of a array?

Hi,
I've received in my program an array dimensioned in another program or process. (its memory address, of course)

It's possible to know how many elements are dimensioned in the array?.

many thanks.
JOAQUIN
by jqn
Mon Oct 23, 2006 1:46 pm
Forum: Coding Questions
Topic: Free software for icons
Replies: 6
Views: 2215

chen wrote:
jqn wrote:SNico:

(¿Y qué hacemos hablando en inglés si sabemos español?)
Es la forma de estar en contacto con todos en el forum...y ademas
practicando nuestro ingles escrito... :wink:
I dont have any doubt...
But it's a part of a spanish joke. (impossible to say it here).

JOAQUIN
by jqn
Mon Oct 23, 2006 8:49 am
Forum: Coding Questions
Topic: We have a Mid replacement. Any thoughts on FindString ?
Replies: 15
Views: 5697

And StringField(String$, Index, Delimiter$) ?
And ReplaceString(String$, StringToFind$, StringToReplace$ [, Mode [, StartPosition]]) ?

Both commands are also used alot.
by jqn
Mon Oct 23, 2006 8:42 am
Forum: Coding Questions
Topic: Free software for icons
Replies: 6
Views: 2215

SNico:

http://www.snidesoft.com
(could be an old connection, if it dont work, seach google for "snico download")

Regards
JOAQUIN

(¿Y qué hacemos hablando en inglés si sabemos español?)
by jqn
Fri Oct 20, 2006 12:48 pm
Forum: Coding Questions
Topic: Search all collumns at once in a database
Replies: 11
Views: 3504

Well, you can type
"Select * from myTablename where concat(myField, myField1, myField2, ...) like '%WhatToLookFor%' "
(or "... contains 'WhatToLookFor' ", if permited in database syntax)

Joaquin
by jqn
Wed Oct 18, 2006 12:18 pm
Forum: General Discussion
Topic: where it is _PB_Gadget_ObjectsArea?
Replies: 0
Views: 751

where it is _PB_Gadget_ObjectsArea?

Hi,
I need to use an example from Freak , about "Gadgets in DLL"
http://www.purebasic.fr/english/viewtopic.php?t=6339

but at compilation, POLINK says "Unresolved external symbol _PB_Gadget_ObjectsArea".

I suppose it has changed in PB4. What is the new symbol for gadget list?

JOAQUIN
by jqn
Mon Oct 09, 2006 11:37 am
Forum: Announcement
Topic: egrid 4 grid gadget - (static PB library version.)
Replies: 365
Views: 97109

Hi srod, a little suggestion:
All function names on egrid starts by "egrid_...".
It's inconsistent whith PB commands terminology, who never uses underscore, my proposal is to delete it.

Good job.