Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, June 20, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Is a creating a Global Array possible?
Paul VanderWaal
Posts: 23
 
Is a creating a Global Array possible?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Sep 07 6:44 AM
I am getting a subscript out of range error when trying to pass a global array. Is this not possible? I'd like to not have to write the array to a temp file first. Here is a sample of what I am trying to do.

Dim aryList(20)
For i = 0 to 19
aryList(i) = "Array item " & i
Next

Application.GlobalInfo.Add "gbl_aryList", aryList()

Thank you.
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Is a creating a Global Array possible?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Sep 07 9:35 AM
Haven't tried this, but how about this:

Application.GlobalInfo.Add "gbl_aryList", aryList [No parenthesis?]

Also, you could build a Delimited String and then Split it into an Array
[Reply][Quote]
Paul VanderWaal
Posts: 23
 
Re: Is a creating a Global Array possible?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Sep 07 9:40 AM
I had that same thought as you suggested without the parens, but that doesn't work either. In the meantime, I populated a hidden listbox on the source view, and upon opening my other view, pulled the items from it, as shown here...

Set objfrmPrintPro = Application.Forms("Contact:PrintPro")
lbItems.Items = objfrmPrintPro.lbTemp.Items
Set objfrmPrintPro = Nothing

This works, but I'd still rather be able to pass the variable as an array if anyone knows. Your string suggestion is a good workaround too. Thank you, Raul.
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Is a creating a Global Array possible?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Sep 07 9:58 AM
If you have gone thru the trouble of getting a reference to the Form, then you might as well do as follows:
On the PrintPro form, make sure your Array is declared with Global Scope
Instead of getting a reference to the Label, get a reference to the Global Array:

Set objfrmPrintPro = Application.Forms("Contact:PrintPro")
Set Arr = objfrmPrintPro.Script.MyArray()
Set objfrmPrintPro = Nothing
[Reply][Quote]
Paul VanderWaal
Posts: 23
 
Re: Is a creating a Global Array possible?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Sep 07 10:11 AM
Sounds like a good option, Raul, but I get an error on the Set Arr line stating Object doesn't support this property or method. Tried it without the parens, same error.
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Is a creating a Global Array possible?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Sep 07 10:16 AM
First of all, my apologies, I am not testing it on SLX.

If you cant retreive it, can you traverse it directly thru the form reference? Still better than having to use the listbox.
[Reply][Quote]
Paul VanderWaal
Posts: 23
 
Re: Is a creating a Global Array possible?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Sep 07 10:22 AM
I can't get to it that way, so since my workaround works, I'm moving on for now. Thanks, Raul.
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Is a creating a Global Array possible?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Sep 07 10:43 AM
I was having the same problems.......finally ended up passing a String of stuff in 'item1', 'item2', 'item3' format......then I can Replase and SPLIT it on the other side/form......or use it in a SQL WHERE clause....... IN('item1', 'item2', 'item3' )

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Is a creating a Global Array possible?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Sep 07 11:55 AM
Quote:
Originally posted by Paul VanderWaal

Sounds like a good option, Raul, but I get an error on the Set Arr line stating Object doesn't support this property or method. Tried it without the parens, same error.


Remove the "Set" part. An array is a technically an object, so there is no reference to set.
[Reply][Quote]
Paul VanderWaal
Posts: 23
 
Re: Is a creating a Global Array possible?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Sep 07 12:01 PM
Thanks Ryan, but removing "Set" doesn't help. Still doesn't work.
[Reply][Quote]
Todd Hardin
Posts: 43
 
Re: Is a creating a Global Array possible?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Sep 07 12:59 AM
I have stored & retrieved ADO recordset objects in SLX global variables.

I was using a disconnected recordset as a data structure because I was using it to share information between a Cypress basic script an a VBScript so did nto think I could pass an array back and forth.

I may have been using the older application.basicfunctions.globalxxxxx functions rather than the newer application.globalinfo collection, maybe there is a subtle difference, I'm not sure.

If I had that code handy I would post it - I'll look for it, not sure if I will be able to find it soon, but thought I might suggest the disconnected recordset object as an alternative as well as assure you that COM objects can be stored & retrieved from the SLX Global variable space.

Todd
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 6/20/2025 10:48:44 AM