Reply
Please Help ASAP .
Old 02-13-2007, 03:17 PM Please Help ASAP .
Junior Talker

Posts: 3
Need a code that could read Directives(which could have multiple arguments) from config files and also be able to update the config files based on user inputs and copy them to their respective binaries.

I'm a beginner ...plz help me out .......thanks
phantom3008 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 02-13-2007, 05:39 PM Re: Please Help ASAP .
chrishirst's Avatar
Super Moderator

Posts: 13,474
Location: Blackpool. UK
more information and we might have half a chance.

such as;

what do these directives look like ?
what binaries are the respective ones ?
what format are the config files?

plus much much more!
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-14-2007, 10:14 AM Re: Please Help ASAP .
Junior Talker

Posts: 3
Quote:
Originally Posted by chrishirst View Post
more information and we might have half a chance.

such as;

what do these directives look like ?
what binaries are the respective ones ?
what format are the config files?

plus much much more!
Actually i have say a couple web based tools for which i need to configure their config files manually each time for different scenarios.I basically need a web based application to be able to update their config files and say save them in a database.
for example one directive could be :
# Syntax: GUIAUTOSTART [0|1]
does this make any sense .... plz advise

phantom3008 is offline
Reply With Quote
View Public Profile
 
Old 02-14-2007, 03:13 PM Re: Please Help ASAP .
chrishirst's Avatar
Super Moderator

Posts: 13,474
Location: Blackpool. UK
Ok assuming I have the gist of what you require to do

database stuff is relatively simple, there are some good code samples at http://www.asp101.com/samples/ to get you started

Being able to read, write and edit single lines in text files is a little more difficult.
There is some VBScript code at http://www.motobit.com/tips/detpg_as...ite-ini-files/ to read and write Windows INI files using the FSO that you should be able to adapt to suit.
Depending on your code skills you should be able to encapsulate it into a class to simplify coding a UI for users & admins.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-15-2007, 11:15 AM Re: Please Help ASAP .
Junior Talker

Posts: 3
I am trying to add two more values to this loop , but it says
Subscript out of range:'i'

under this loop i'm trying to add

Code:

for i=0 to (x-1)sql = "insert into table values (null,"&projID&",'"&sSim_host(i)&"','"&sSim_dir(i) &"','"&sSim_ip(i)&"',"&sSim_suid(i)&","&sSim_numBE S(i)&","&sSim_startPIN(i)&","&sSim_numPIN(i)&","&s Sim_dupPIN&",'"&sSim_authKey(i)&","&sSim_size(i)&","&sSim_contype(i)&"')"db_conn.execute(sql)next
the ones in bold/italic are the added ones. .. plz advise
phantom3008 is offline
Reply With Quote
View Public Profile
 
Old 02-15-2007, 03:08 PM Re: Please Help ASAP .
chrishirst's Avatar
Super Moderator

Posts: 13,474
Location: Blackpool. UK
any chance we could look at formatted code ?? makes it simpler to read and debug

and what is the declaration for sSim_size and sSim_contype ?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-15-2007, 04:28 PM Re: Please Help ASAP .
chrishirst's Avatar
Super Moderator

Posts: 13,474
Location: Blackpool. UK
just as an after thought;

instead of playing around with several unsynched arrays why not write a class for your data, then create an array of [class] to hold everything.
It isn't as difficult as you would think.

ASP VBScript code for a simple class holding two properties.
Extend this by adding more local variables.
Add more LET & GET property functions to suit the array names you currently have and you will have a method which will keep your values in sync.

BTW. The m_sName notation is the way I declare variables m_ indicates it's scope is Module level and the s is a string value.

Code:
<SCRIPT LANGUAGE=vbscript RUNAT=Server>
Class clsUDT
' declare the local variables to hold the data value 
private m_sProp1
private m_sProp2

' a GET property is the function used to return the value back to the calling routine
' eg response.write clsObject.stringOne
public property GET stringOne()
	stringOne = m_sProp1
end property

' a LET property is the function used to set the property 
' eg clsObject.stringOne = "some value for this" 

public property LET stringOne(value)
	m_sProp1 = value
end property

public property GET stringTwo()
	stringTwo = m_sProp2
end property

public property LET stringTwo(value)
	m_sProp2 = value
end property

end class
</script>
Sample code to instantiate, set, use and destroy the objects
Code:
dim UDTtest(2)
for i = 0 to ubound(UDTtest)
' instantiate an array of the class
set UDTtest(i) = new clsUDT
next
' set some values
UDTtest(0).stringone = "1: "
UDTtest(1).stringone = "2: "
UDTtest(2).stringone = "3: "
UDTtest(0).stringtwo = "test string ONE"
UDTtest(1).stringtwo = "test string TWO"
UDTtest(2).stringtwo = "test string THREE"

' show the values in the browser
for i = 0 to ubound(UDTtest)
response.write UDTtest(i).stringone
response.write UDTtest(i).stringtwo
response.write "<br>"
next

for i = 0 to ubound(UDTtest)
' destroy all instances
set UDTtest(i) = nothing
next
The class code can be in the asp page or in a seperate included file but must be surrounded by the <script> tags

and there you are, OOP with ASP (almost)
Have fun
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Please Help ASAP .
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.14693 seconds with 12 queries