Search found 31 matches

by ukandrewc
Mon Oct 11, 2004 9:45 am
Forum: Coding Questions
Topic: passing strings
Replies: 23
Views: 5187

PB String functions cannot cope with Unicode either.
They all seem to. Strings passed from VB can be manipulated, parsed into arrays and sorted.
by ukandrewc
Sun Oct 10, 2004 4:31 pm
Forum: Coding Questions
Topic: passing strings
Replies: 23
Views: 5187

thanks Tinman, I have tested a few functions in PB for speed.
As PB is faster than VB, I wanted a simple way to pass a pointer to a string and manipulate them.
As you say, the PB compiler appears to cast variables to the correct type which makes it difficult.
Some other basics make this simple, I ...
by ukandrewc
Sun Oct 10, 2004 1:41 pm
Forum: Coding Questions
Topic: passing strings
Replies: 23
Views: 5187

Hello GedB

I can see that your example should work but it still seems to create a copy of the string.

Ideally I need to manipulate a string in PB, passed by pointer from VB. I can pass the address of a string.

If I use memory functions, then I can confirm that it is the same string, but any ...
by ukandrewc
Sun Oct 10, 2004 9:19 am
Forum: Coding Questions
Topic: passing strings
Replies: 23
Views: 5187

OK, thanks GedB

I am familiar with ASM but it's things like the ! in front of assembler commands that don't seem to be documented

Andrew
by ukandrewc
Sat Oct 09, 2004 10:37 pm
Forum: Coding Questions
Topic: passing strings
Replies: 23
Views: 5187

Thanks for that, I'll have a play.

Where is all this stuff documented?

Andrew
by ukandrewc
Sat Oct 09, 2004 9:46 pm
Forum: Coding Questions
Topic: passing strings
Replies: 23
Views: 5187

Hello

Unfortunately I get an 'undefined variable' error when compiling the example, any help would be appreciated.
by ukandrewc
Sat Oct 09, 2004 8:40 pm
Forum: Coding Questions
Topic: passing strings
Replies: 23
Views: 5187

Thanks wilbert, I'll play with that.

I want to be able to pass a pointer to a string from VB and manipulate it in PB.

The actual code would be more like:

Code: Select all

ProcedureDLL ManipulateString(PtrString.l)
a$=""
! pushd [v_PtrString] 
! popd [v_a$]
Thanks again
by ukandrewc
Sat Oct 09, 2004 6:01 pm
Forum: Coding Questions
Topic: passing strings
Replies: 23
Views: 5187

Maybe I was a little premature. PeekS creates a new string, I am after a way to get a string variable for the same string.
e.g.

Code: Select all

b$=PeekS(PtrString)
;Creates a new string

;I need something like
b$=""
;Then point b$ at PtrString
Thanks
by ukandrewc
Sat Oct 09, 2004 5:49 pm
Forum: Coding Questions
Topic: passing strings
Replies: 23
Views: 5187

Excellent, thanks num3

PB does seem to be a powerful language but it does take some time to know.

Thanks again

Andrew
by ukandrewc
Sat Oct 09, 2004 5:25 pm
Forum: Coding Questions
Topic: passing strings
Replies: 23
Views: 5187

passing strings

Hello

I was wondering how to get a pointer to a string into a string variable so that I can use string functions on it e.g.

Code: Select all

Procedure AmendString(PtrToString.l)

;I appreciate this isn't valid but how do you assign pointer to string

String.s=PtrToString
Many thanks
by ukandrewc
Fri Oct 08, 2004 10:17 am
Forum: Coding Questions
Topic: Inserting text in strings
Replies: 19
Views: 4201

FYI

I discovered that there is a command for my problem, CopyMemoryString is documented in the help file

Thanks again
by ukandrewc
Thu Oct 07, 2004 10:00 pm
Forum: Coding Questions
Topic: Inserting text in strings
Replies: 19
Views: 4201

Yes, after the advice I have written my own mid function that uses pointers.

Thanks again everyone
by ukandrewc
Thu Oct 07, 2004 9:29 am
Forum: Coding Questions
Topic: Inserting text in strings
Replies: 19
Views: 4201

Thanks wilbert, that is a great help.

I mainly use PB for creating faster routines to call from VB.

I hadn't realised about the string limit - probably because I tend to pass strings from VB.
by ukandrewc
Wed Oct 06, 2004 11:29 pm
Forum: Coding Questions
Topic: Inserting text in strings
Replies: 19
Views: 4201

This is the VB code
test = Space$(100010)
Mid$(test, 100000, 10) = "hello mum!"
TestString test
This is the PB code:
ProcedureDLL TestString(Test.s)
MessageRequester(Str(Len(Test)),Mid(Test,100000,10))
EndProcedure
It works - but if you say it can't, then I will use it but pretend that it doesn ...
by ukandrewc
Wed Oct 06, 2004 7:29 pm
Forum: Coding Questions
Topic: Inserting text in strings
Replies: 19
Views: 4201

Thanks for the info wilbert.

I assume that you mean the working buffer space? If so how do you increase it?

I have used the following:

Code: Select all

ProcedureDLL.l SortString(Str.s)
x$=mid(Str,300000,10)
debug x$
Which is fine for my needs as I am only need to find strings of <100 characters.