![]() |
![]() |
#1 |
Registered User
Join Date: Dec 2017
Location: Poland
Age: 48
Posts: 284
|
How to assign some buffer for a string?
I need to use AddPart_() command and (if I understood it correctly) the modified/final path will be stored in first variable passed to that function (ie. Dirname).
The problem starts here because that variable (buffer in memory) must be long enough to accommodate new path string. How to do this in blitz? Thanks |
![]() |
![]() |
#2 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,381
|
The Maxlen keyword is used for reserving string space:
Code:
Maxlen myName$ 512 Code:
succ.l = Addpart_(&myName$, &myPart$, 512) Code:
NPrint Peek.s(&myName$) Code:
myName$ = Peek.s(&myName$) Last edited by Daedalus; 21 August 2018 at 11:19. |
![]() |
![]() |
#3 |
Registered User
Join Date: Dec 2017
Location: Poland
Age: 48
Posts: 284
|
It works!!
And you were right about reading the string directly. Thanks!! Just small correction : Code:
succ.l = Addpart_(myName$, myPart$, 512) |
![]() |
![]() |
#4 | |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,381
|
Quote:
![]() As an aside, it is possible to use string parameters without the & for system calls where the string is not modified by the function, just not where the string is to be modified by the system. But it's probably best to use the & just in case. |
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
os 3.1 string length limit | Miggy | support.Apps | 1 | 07 September 2014 21:05 |
string starts with | AGS | Coders. Asm / Hardware | 24 | 24 August 2014 16:09 |
highlight string | kkhard | Coders. C/C++ | 0 | 15 August 2014 04:26 |
SetPatch 44+ copyright string | amiga_user | support.Apps | 20 | 03 April 2011 01:55 |
|
|