[Gambas-user] Problem with String[]

Dag JNJ gambas at cd-bahia.com
Sun Nov 20 22:33:07 CET 2022



Am 18.11.22 um 17:51 schrieb T Lee Davidson:
> On 11/17/22 13:25, Dag JNJ wrote:
>> Hi all,
>> I have defined this:
>>
>> P/ublic arorder As New String[]//
>> //Public arorderb As New String[]//
>> /
>> and make this in a subroutine:
>>
>> /    arorder.Add(fld)//
>> //    arorderb.Add(ada)
>>
>> ///
>> /fld/ contains a field name, /ada/ = "ASC"
>>
>> the first assignment with /aroder/ succeeds, the second with 
>> /arorderb/ makes an error : null object
>> I can't see any difference between these objects, and they are only 
>> changed in  this routine (so far).
>> I am thankful for any help, allt he best, Dag JNJ
>
> It is quite difficult to determine what may be causing that without 
> seeing the full code. Perhaps somewhere 'arorderb' is getting 
> nullified. Can you pare it down to a small project, that reproduces 
> the issue, that you can share?
>
>

Thanks for the feedback.
I made a silly (beginners!) error.

I defined EKT_order and EKT_orderby by like this:  _
/Public EKT_order as ////New //String[]
///Public EKT_orderby as String[]

//and called a Procedure

/MakeOrderType(EKT order , ///EKT orderby,/, fld , Column)

//Public Procedure MakeOrderType(arorder As String[], arordorb As 
String[], fld As String, clmn As Byte)

/Shame on me, cost me almost two days seeking the error. I just forgot 
New. Found it at last. Really embarrassing.

Best regards,
Dag
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221120/a199f655/attachment.htm>


More information about the User mailing list