Hi,
I have been working on a project with the web application server and have been attempting desperately to teach myself xBasic. I am attaching a file with all my code so far and the database. At the moment I am stuck with arrays and a proper theory on how to accomplish my task. There is a file included in the zip called invtheory.txt that explains where I am at.
If anybody can assist me with the proper way of using an array, or if they know of a better way to accomplish my task it would be greatly appreciated.
Below is what I have been able to find in the help files for xBasic on arrays.
dim useraccess[10] as P
useraccess.initialize_from_table("d:\comp_sec.dbf","user_num=" + session.user_num)
Unfortunately I do not understand the full concept here and how to call this array or where to place the above code so that it fits in with what I am trying to do. If I read the help pages correctly, the above should take the information from the comp_sec table that matches the user_num of the person logged in and place those specific records into an array called useraccess.
Above I am not declaring the variable as global or as a session variable, not sure if I can do either with arrays. But would like to if possible so that I can use this specific array in multiple areas of the webpages. I am also not sure if I am better off choosing session over global as I am using session for the user_num and other fields.
I have also chosen [10] but would prefer to make that number grow automatically as records are added since we really do not know at this time how large this table will grow. I did not fully understand that portion of the help files either :(
Lenny very elegantly explained the syntax for the above array and I will share it here in case anybody else is ever as confused as me :)
The prototype is "ARRAY>.INITIALIZE_FROM_TABLE( Table_Name as C [, Filter as C [, Order as C ]] )
"table_name as c" indicates a parameter called table_name that is a character. You would simply pass in the name of your table, "d:\comp_sec.dbf" in this case. You should not include the "as c".
The [] square brackets indicate an optional parameter and should not be included. You also need a comma between parameters.
Note that I am using a lot of include files and trying to create a lot of UDF as I will be able to use a lot of this code in several areas once I get the inventory side figured out. I have not included all of the files, only the ones that are needed for the inventory theory.
Thanks
Cheryl
I have been working on a project with the web application server and have been attempting desperately to teach myself xBasic. I am attaching a file with all my code so far and the database. At the moment I am stuck with arrays and a proper theory on how to accomplish my task. There is a file included in the zip called invtheory.txt that explains where I am at.
If anybody can assist me with the proper way of using an array, or if they know of a better way to accomplish my task it would be greatly appreciated.
Below is what I have been able to find in the help files for xBasic on arrays.
dim useraccess[10] as P
useraccess.initialize_from_table("d:\comp_sec.dbf","user_num=" + session.user_num)
Unfortunately I do not understand the full concept here and how to call this array or where to place the above code so that it fits in with what I am trying to do. If I read the help pages correctly, the above should take the information from the comp_sec table that matches the user_num of the person logged in and place those specific records into an array called useraccess.
Above I am not declaring the variable as global or as a session variable, not sure if I can do either with arrays. But would like to if possible so that I can use this specific array in multiple areas of the webpages. I am also not sure if I am better off choosing session over global as I am using session for the user_num and other fields.
I have also chosen [10] but would prefer to make that number grow automatically as records are added since we really do not know at this time how large this table will grow. I did not fully understand that portion of the help files either :(
Lenny very elegantly explained the syntax for the above array and I will share it here in case anybody else is ever as confused as me :)
The prototype is "ARRAY>.INITIALIZE_FROM_TABLE( Table_Name as C [, Filter as C [, Order as C ]] )
"table_name as c" indicates a parameter called table_name that is a character. You would simply pass in the name of your table, "d:\comp_sec.dbf" in this case. You should not include the "as c".
The [] square brackets indicate an optional parameter and should not be included. You also need a comma between parameters.
Note that I am using a lot of include files and trying to create a lot of UDF as I will be able to use a lot of this code in several areas once I get the inventory side figured out. I have not included all of the files, only the ones that are needed for the inventory theory.
Thanks
Cheryl
Comment