Normal Topic Adaptability of Application - Needs Idea (Read 1081 times)
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Adaptability of Application - Needs Idea
Mar 10th, 2009 at 4:49pm
Print Post Print Post  
I have an application with several Databases and forms and made specially to work on Client / Server platform. In order for it to adapt to various setups without changing the codeing, I have made one database with only one record having various printer names, server and client names, various option as to one wants to print with option to preview with various forms, whether want to select the printer before printer with various printing chores, level One users List, Level two users list (in order to contorl accessibility), etc. I named this database and form setup that has also made part of the application.

Since it contains only one record, I get the relevant info using @xResultsetcommand ( ) whenever I want to get those values from the setup database. It works. However, I believe, there has to be a better way. May be something like setup.ini file and getting all the value in the globalvalue  variables so, it can be available all time and do not have to called in @xResultSetCommand () to get the value.

What is the code for reading .ini text file, to remove //comments etc. and form a string of value and getting them using @AccessStringArrary ( )?  How one would use .ini file to achieve the goal?

Any ideas? Any suggestions?  Thanks.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Adaptability of Application - Needs Idea
Reply #1 - Mar 10th, 2009 at 8:16pm
Print Post Print Post  
The parsing and putting in a StringArray depends on the format of your file, but a simple loop for reading a text file line by line is on page 237 of the Sesame 2 Programming Guide under the FileReadLn command.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Adaptability of Application - Needs Idea
Reply #2 - Mar 10th, 2009 at 9:08pm
Print Post Print Post  
Thanks Erika. I can either parse text file with format just like sesame.ini file and form the @GlobalValue () for each entity on the file, like

PrevewPrescription = Yes

Globalvalue ("PreviewPrescription", "Yes")

and then in the code, I can use it like

if @Globalvalue ("PreviewPrescription") = "Yes" then
       {

        }

I can do the same thing by picking up the value from Setup database and assign them to respective Globalvalue variable, Name of the Element becomes the Globalvalue ( ) name and value of the element becomes the value of the GlobalValue ( ) variable.

Making and loading 15 to 20 global variable...  How much resources does the application use. Is it practical?

With Database option, my file is protected and nobody can manipulate it.

Which one is better and practical way to go?

Your advice is very much appreciated.
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Adaptability of Application - Needs Idea
Reply #3 - Mar 11th, 2009 at 3:05pm
Print Post Print Post  
Before implementing and creating globalvalues, I would like to know how much load it creates on an application? In other words, how much resources it uses. Once implementing and creating such design, if I want to change it and get rid of all the globalvalue ( ) variables from the application, how do I do it? 

Deleting all Globalvalues from Globalvalue manager in Designer and choosing to overwrite them while reconciling, will do away with all Globalvalue ( ) variables even if they are created in during runtime application?

I understand the scope and use of globalvalue (), but I need to know more about how it could affect the future working and it effects on application as far as speed and load on application if it is overused.

  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Adaptability of Application - Needs Idea
Reply #4 - Mar 11th, 2009 at 3:42pm
Print Post Print Post  
Unless you are writing a book in each of them, 20 GlobalValues is a very small number. Performance will not suffer by their presence.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Adaptability of Application - Needs Idea
Reply #5 - Mar 11th, 2009 at 4:34pm
Print Post Print Post  
Thanks Erika. That was a relief! Well, many of them will have  boolean value and rest of them will have a couple of words or a small string.

Deleting all Globalvalues from Globalvalue manager in Designer and choosing to overwrite them while reconciling, will do away with all Globalvalue ( ) variables even if they are created in during runtime application?

There is no globalvalue () manager in runtime. If while reconciling, it it overwrite just the values of the Globalvalue variables and not the globalvalue variable themselves, how do you get rid of them from runtime once they exist in runtime if you need to or want to?
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Adaptability of Application - Needs Idea
Reply #6 - Mar 11th, 2009 at 6:04pm
Print Post Print Post  
You can only get rid of them by deleting them in Designer and reconciling. You can set them to blank values in runtime, but you can't delete them. There's really not a need to do so. Having them there does no harm, especially for such a small number of them.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged