Page 2 of 3 <123>
Topic Options
#196948 - 2009-12-02 08:40 PM Re: another project any guidance would be appreciated [Re: itdaddy]
eriqjaffe Offline
Hey THIS is FUN

Registered: 2004-06-24
Posts: 214
Loc: Arlington Heights, IL USA
No, you have to get the UDFs separately.
Top
#196949 - 2009-12-02 10:58 PM Re: another project any guidance would be appreciated [Re: itdaddy]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
 Originally Posted By: itdaddy

....
hey do you guys know of the function to force lower case letters on a name
i need the pcAlias=tolower($Element) to do something like that?
i cant find the tolower function?? in kix
....


Kix has Ucase and Lcase to convert to upper or lower case characters.
See the example below.
 Code:
Break on

$test = "ABCdefGHI"
? LCase($test)
? UCase($test)
Sleep 5


 Originally Posted By: itdaddy

...
so I need to some do a scan and find it in this block
and then edit it? how do i do that?


If the section is always called UBS then you can just use the ReadProfileString funtion (build in in kix. it does not matter if the name value to read in the first second or whatever line.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#196950 - 2009-12-03 01:03 AM Re: another project any guidance would be appreciated [Re: itdaddy]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
 Code:
If ReadProfileString('.\fsp.ini', 'Ubs', 'pcAlias') <> 'Correct_Value'
  $Rc = WriteReadProfileString('.\fsp.ini', 'Ubs', 'pcAlias', 'Correct_Value')
EndIf
See - three lines, no UDFs.

Just reference the correct path for '.\fsp.ini', and change the 'Correct_Value' string to what you need.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#196956 - 2009-12-03 12:11 PM Re: another project any guidance would be appreciated [Re: itdaddy]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 686
Loc: Maryland, USA
Itdaddy, I may be missing something, but won't it be easier to just use readprofilestring as earlier suggested instead of reading the entire file into an array?
Top
#196958 - 2009-12-03 01:00 PM Re: another project any guidance would be appreciated [Re: itdaddy]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
 Originally Posted By: itdaddy
hey do you guys know of the function to force lower case letters on a name
Once again, the manual is your friend..

I suggest that you (and anyone else not totally familiar with the Kix language) take 10 minutes, browse to the online command reference, and do the following:
Create a spreadsheet with two columns.. in the left column, copy & paste the COMMAND name
In the right column, copy & paste the ACTION sentence.

You now have a command index. It simply lists the commands that are available and what they do.. it can likely fit on one double-sided page. If you want to know how to use the command, you check the manual or online reference.

The biggest challenge that most of my students have is knowing what commands exist, whether we're talking about programming, or Unix shell. Most people can read the manual and figure out what to do once they know which command to use.

I have a similar chart on the wall of my office, except it references the UDFs in my library. Saves lots of wear on the bald spot. ;\)

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#196962 - 2009-12-03 03:31 PM Re: another project any guidance would be appreciated [Re: Glenn Barnas]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 686
Loc: Maryland, USA
Ah, that is what is under the hat! I just don't bother hiding mine. \:\)
Top
#196964 - 2009-12-03 04:03 PM Re: another project any guidance would be appreciated [Re: BradV]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
LOL - I wasn't hiding it.. I was protecting it from sunburn! \:D

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#196967 - 2009-12-03 04:38 PM Re: another project any guidance would be appreciated [Re: Glenn Barnas]
itdaddy Offline
Starting to like KiXtart

Registered: 2006-12-19
Posts: 145
Loc: Wisconsin
Glenn and Apronk you both were right..darn
I shuld have just listen to you both. When I used
eriqjaffe code it distorts the INI file big time weird stuff happens
but we both tried. It was nice to see what happens with and INI file wow
really weird stuff for the outputarray..I might end up doing it in C++
I know C++ better than Kixtart. But will give the enumINI UDFs a try.
and get back with you guys later once I have perfected it.

and to you eriqjaffe thanks for helping me. I learned more about Kix from using your code thank you ver much sir!
-Robert
_________________________
Robert
A+, CCNA, MCP
Network Admin
Credit Union Wisconsin

Top
#196968 - 2009-12-03 04:41 PM Re: another project any guidance would be appreciated [Re: Glenn Barnas]
itdaddy Offline
Starting to like KiXtart

Registered: 2006-12-19
Posts: 145
Loc: Wisconsin
Oh I see cool! wow hey thanks was wondering how to handle the dynamic line of code like that. wow thank yeah will have to use the enumini like you guys suggested the other way distorts the ini file output array big time
;\)
_________________________
Robert
A+, CCNA, MCP
Network Admin
Credit Union Wisconsin

Top
#196969 - 2009-12-03 04:41 PM Re: another project any guidance would be appreciated [Re: Mart]
itdaddy Offline
Starting to like KiXtart

Registered: 2006-12-19
Posts: 145
Loc: Wisconsin
hey mart
thanks for you help duh i forgot that function . hey thanks for the reminder ;\)
_________________________
Robert
A+, CCNA, MCP
Network Admin
Credit Union Wisconsin

Top
#196970 - 2009-12-03 04:44 PM Re: another project any guidance would be appreciated [Re: Mart]
itdaddy Offline
Starting to like KiXtart

Registered: 2006-12-19
Posts: 145
Loc: Wisconsin
oh mart and glenn thanks and thanks glenn for the example code that helps
wow this is so cool will post everything when i am done to give a complete code i am using. super !man I have learn so much
_________________________
Robert
A+, CCNA, MCP
Network Admin
Credit Union Wisconsin

Top
#196971 - 2009-12-03 04:46 PM Re: another project any guidance would be appreciated [Re: Glenn Barnas]
itdaddy Offline
Starting to like KiXtart

Registered: 2006-12-19
Posts: 145
Loc: Wisconsin
oh glenn
i thought they were UDFs to be reference oops my bad! ;hee hee way cool! way cool!
_________________________
Robert
A+, CCNA, MCP
Network Admin
Credit Union Wisconsin

Top
#196972 - 2009-12-03 05:12 PM Re: another project any guidance would be appreciated [Re: Glenn Barnas]
itdaddy Offline
Starting to like KiXtart

Registered: 2006-12-19
Posts: 145
Loc: Wisconsin
Hey glenn it gives me an error on the write I am sure my syntax is wrong?
I will keep trying, but any suggestions will be helpful..thanks
back to the debugging and trial and errror. thanks
 Code:
Break on
Dim $PClist
Dim $array

$PClist = "ftran1", "ftran2", "ftran3"

for each $Element in $PClist
	If ReadProfileString('.\fsp.ini', 'Ubs', 'PCAlias') <> 'PCAlias=$Element'
	LCase($Element)
	? $Element
  	$Rc = WriteReadProfileString('.\fsp.ini', 'Ubs', 'pcAlias', 'PCAlias='+$Element)
	Shell "CMD.EXE /C xcopy .\fsp.ini  \\$Element\c$\WINDOWS\ /y"
EndIf
 
next

_________________________
Robert
A+, CCNA, MCP
Network Admin
Credit Union Wisconsin

Top
#196973 - 2009-12-03 05:29 PM Re: another project any guidance would be appreciated [Re: itdaddy]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
My head hurts...

Please look at my example - carefully.. then look at your code - they are quite different.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#196975 - 2009-12-03 05:39 PM Re: another project any guidance would be appreciated [Re: Glenn Barnas]
itdaddy Offline
Starting to like KiXtart

Registered: 2006-12-19
Posts: 145
Loc: Wisconsin
sorry glenn,
not sure what goes in the correct_value is that the value on the right
of the = sign? of pcalias? sorry for not understanding.



 Code:

$PClist = "ftran1", "ftran2", "ftran3"

for each $Element in $PClist

	If ReadProfileString('fsp.ini', 'Ubs', 'pcAlias') <> '$Element'
	$Element = LCase($Element)
  	$Rc = WriteReadProfileString('fsp.ini', 'Ubs', 'pcAlias', '$Element')
	EndIf

next



Edited by itdaddy (2009-12-03 05:44 PM)
_________________________
Robert
A+, CCNA, MCP
Network Admin
Credit Union Wisconsin

Top
#196977 - 2009-12-03 06:01 PM Re: another project any guidance would be appreciated [Re: itdaddy]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Closer..

Get the variables out of the quotes - $Element, not '$Element', and you need to make up your mind - READWRITEprofilestring is much too indecisive - do you want to READ or WRITE a profile string? ;\)

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#196978 - 2009-12-03 06:06 PM Re: another project any guidance would be appreciated [Re: Glenn Barnas]
itdaddy Offline
Starting to like KiXtart

Registered: 2006-12-19
Posts: 145
Loc: Wisconsin
thanks sorry about that..my goal is only to write a string only
then copy that file to the respective $Element and then do it again for the next $Element..I just want the code to find the PCAlias= line and place
the $Element on the line. I know that you know that but I am just resummarizing it. will give it a go! thank you

what do you mean about the read or right? then do I leave the <> ''
blank like that and then leave $Element in the write line?


Edited by itdaddy (2009-12-03 06:08 PM)
_________________________
Robert
A+, CCNA, MCP
Network Admin
Credit Union Wisconsin

Top
#196979 - 2009-12-03 06:11 PM Re: another project any guidance would be appreciated [Re: itdaddy]
itdaddy Offline
Starting to like KiXtart

Registered: 2006-12-19
Posts: 145
Loc: Wisconsin
Hey glenn I keep getting this error..man do I feel stupid here..

 Code:

C:\KIX>kix32 RFSPINI.KIX

ERROR : expected ')'!
Script: C:\KIX\RFSPINI.KIX
Line  : 11

C:\KIX>PAUSE
Press any key to continue . . .


and my code is now this?

 Code:
for each $Element in $PClist

	If ReadProfileString('C:\KIX\fsp.ini', 'Ubs', 'pcAlias') <> ''
	$Element = LCase($Element)
  	$Rc = WriteReadProfileString('fsp.ini', 'Ubs', 'pcAlias', $Element )
	EndIf

next


do you mean take out the if/endif statement and the read function? and just leave the write function?
_________________________
Robert
A+, CCNA, MCP
Network Admin
Credit Union Wisconsin

Top
#196980 - 2009-12-03 06:17 PM Re: another project any guidance would be appreciated [Re: itdaddy]
itdaddy Offline
Starting to like KiXtart

Registered: 2006-12-19
Posts: 145
Loc: Wisconsin
Glenn you would be pround of your dumb code monkey(hee hee)
I looked at the kix manual for WriteReadProfileString()
and took out the 'Read' and it works ;\)
hahhaa
you the man glenn now take care of that headache! ahah
thanks fortaking your time to help me;) really
glenn this works perfect thanks
some day I hope I am as good as you are probably not
but I will try ;\)
 Code:
$PClist = "ftran1", "ftran2", "ftran3"

for each $Element in $PClist
	$Element = LCase($Element)
	? $Element
  	$Rc = WriteProfileString('C:\KIX\fsp.ini', 'Ubs', 'pcAlias', $Element)
	sleep 20

next



Edited by itdaddy (2009-12-03 06:20 PM)
_________________________
Robert
A+, CCNA, MCP
Network Admin
Credit Union Wisconsin

Top
#196981 - 2009-12-03 06:20 PM Re: another project any guidance would be appreciated [Re: Glenn Barnas]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
 Quote:
My head hurts...


LOL!

I don't think it was the sunburn this time.

Top
Page 2 of 3 <123>


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 540 anonymous users online.
Newest Members
Timothy, Jojo67, MaikSimon, kvn317, kixtarts2025
17874 Registered Users

Generated in 0.077 seconds in which 0.029 seconds were spent on a total of 15 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org