initialize()=
declare
Bob = array of StringObject;
Kate = array of StringObject;
Enddeclare
Begin
Bob[1].Value = ‘I work OK’;
Kate[1].ConcatVarchar(text = ‘I do not – I say E_WT0033 Row 1 is out of range for an array access’);
End;
I just spotted this messing about with JSONObject and the URLConnection class.
A class attribute reference makes me a Stringobject in the array first, but not a method invocation.
It is possible that I have never tried using a Method invocation in a ‘First Assignment’ context in the last 33 years.
Must be all this Python corrupting my mind.
Cheers
Adrian
Bodo Bergmann Engineering Architect | OpenROAD Engineering Actian, a division of HCLSoftware | |
GESELLSCHAFTSANGABEN: Actian Germany GmbH | Registry Off: Halenreie 42, 22359 Hamburg | Geschäftsführung: Stephen Padgett, Marc Monahan | Handelsregister: Amtsgericht Hamburg | HRB 135991 | USt-IdNr: DE252449897 |
--
You received this message because you are subscribed to the Google Groups "OpenROAD Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openroad-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openroad-users/001701da8699%24d24645f0%2476d2d1d0%24%40rationalcommerce.com.
> You cannot invoke a method on a non-existing object.
Or an attribute access on a non existent object – but the array code has a special case for attribute access and does it for you, but not for the method.
The lack of symmetry made me pause, but I did this:
wwwheaders[2].value = '';
wwwheaders[2].ConcatVarchar(text = 'Authorization: Bearer ' ) ;
While I have your attention:
This Curl with the -d daisy chained text:
/*
curl -X POST -H 'Content-Type: application/x-www-form-urlencoded' \
https://login.microsoftonline.com/your_tenant_id/oauth2/token\
-d 'client_id=your_app_client_id' \
-d 'grant_type=client_credentials' \
-d 'resource=wwws://management.azure.com/' \
-d 'client_secret=*******************'
*/
In OpenROAD I got it working like so with ampersands:
PostData.Concatvarchar(text ='&client_id=0af2e49f-73bc-466b-8ca5-6e7b91e251ab' );
PostData.Concatvarchar(text ='&grant_type=client_credentials' );
PostData.Concatvarchar(text ='&resource=https://management.azure.com/' );
PostData.Concatvarchar(text ='&client_secret=2.D8Q~Ml5x_IlB4eK_kFt7VfI3D2y2H8vHZAsaQd' );
//CurExec.Trace(string = PostData);
/* Nope, does not work like the -d shown above
www.SetOption(option = CURLOPT_POSTFIELDS, value = 'client_id=<some garbage>');
www.SetOption(option = CURLOPT_POSTFIELDS, value = 'grant_type= client_credentials ');
www.SetOption(option = CURLOPT_POSTFIELDS, value = 'resource=https://management.azure.com/');
www.SetOption(option = CURLOPT_POSTFIELDS, value = 'client_secret=<more garbage>');
*/
Should I have passed an array of StringObject for that?
I got it working and carried on – but seeing as you are here….
Cheers
Adrian
PS I thought this google group was supposed to stop working?
From: openroa...@googlegroups.com <openroa...@googlegroups.com> On Behalf Of Bodo Bergmann
Sent: 04 April 2024 15:21
To: openroa...@googlegroups.com
Subject: Re: [openroad-users] Array population thing I just spotted...
This is expected (and documented) behavior.
You cannot invoke a method on a non-existing object.
But when you assign an attribute on an array row that has an index of lastrow+1, then a new object is automatically created (and assigned to that row) before assigning the attribute value.
This has been the behavior since the beginning of OpenROAD (Windows/4GL in the late 1980s 😀) .
Cheers,
Bodo
Bodo Bergmann Engineering Architect | OpenROAD Engineering Actian, a division of HCLSoftware | |
To view this discussion on the web visit https://groups.google.com/d/msgid/openroad-users/CAObuDgvYizvQehb41jmHQLk5bZu_z6MKMfxduiKcq5p9EQUSdw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openroad-users/002701da86a1%2453527360%24f9f75a20%24%40rationalcommerce.com.
Cheers,
To view this discussion on the web visit https://groups.google.com/d/msgid/openroad-users/CAObuDgsQH9r2AKL_cVQ9L_7UUFcBjLwP3wG7h%3DRZBDyOH%3D_5Jw%40mail.gmail.com.