Page 1 of 1 1
Topic Options
#153999 - 2005-12-23 01:58 PM RFC on possible new UDF
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Created this as I had a specific need.

Please comment, and should this be an UDF after all comments are done?

Code:


;FUNCTION Convert2array
;
;ACTION Take a plain text file and convert it into an array
; that allows for use of includes
;
;AUTHOR Gargoyle
;
;CONTRIBUTORS Many for the suggestions on how to create this
; so that you can then tokenize the data and still
; "include".
;
;VERSION 1.0.1
;
;DATE CREATED 12.23.05
;
;DATE MODIFIED 12.23.05
;
;KIXTART Only tested with 4.51
;
;SYNTAX Convert2array(FileToConvert,FileToSave,ArrayName)
;
;PARAMETERS
; File to Convert
; Name of the input file, if not in the scriptdirectory
; specify full path name
;
; File to Save
; Name of the output file, if you don't want it in the
; script directory specify the full path.
;
; Array Name
; What name to you want to assign to the created array elements
;
;RETURNS Nothing
;
;REMARKS
;
;DEPENDENCIES
;
;KIXTART BBS
;
;


Function Convert2Array($IN,$Out,$Name)
SetOption ("NoVarsInStrings", ON)
Dim $Read, $Count, $FH, $In, $Out, $Name, $Array[]
$FH = FreeFileHandle()
$Count = 0
If Open($FH,$IN,2) = 0
$Read = ReadLine($FH)
While @ERROR = 0
ReDim Preserve $Array[$Count]
$Array[$Count] = $Read
$Count = $Count + 1
$Read = ReadLine($FH)
Loop
Close($FH)
Else
$ = MessageBox("Error opening File" + @CRLF + @SERROR,"Warning",16)
Exit @Error
EndIf

If Open($FH,$OUt,5) = 0
For $ = 0 to Ubound($Array)
WriteLine($FH,"$"+$Name+"["+$+"] = '" + $Array[$] + "'"+@CRLF)
Next
Close($FH)
Else
$ = MessageBox("Error opening File" + @CRLF + @SERROR,"Warning",16)
EndIf
EndFunction



Edited by Gargoyle (2005-12-23 03:38 PM)
_________________________
Today is the tomorrow you worried about yesterday.

Top
#154000 - 2005-12-23 02:04 PM Re: RFC on possible new UDF
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Why a message box when the file open gives an error? Wouldn't Exit @error be better.

Edited by Mart (2005-12-23 02:04 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#154001 - 2005-12-23 02:09 PM Re: RFC on possible new UDF
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
Have you seen ReadFile() and WriteFile() UDFs
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#154002 - 2005-12-23 02:45 PM Re: RFC on possible new UDF
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I bet he has but this is different.
he wants to inbuild the data instead of dragging it in separate file.
_________________________
!

download KiXnet

Top
#154003 - 2005-12-23 03:37 PM Re: RFC on possible new UDF
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Quote:

Wouldn't Exit @error be better.




I had meant to add a Exit @error under the messagebox. The messagebox was simply to let the user know that the file name was bad.

Quote:

he wants to inbuild the data instead



Exactly, I have very large data files in excess of 100 entries each and there is currently 5 of these files.

I will be calling these files as part of my script, and this gives me the ability to tokenize the data files so that users can not "easily" modify the data.

After I posted I realized that this is more of a standalone script rather than an UDF, but oh well I had already posted it as such.

I have edited the script to add the Exit @Error.
_________________________
Today is the tomorrow you worried about yesterday.

Top
#154004 - 2005-12-23 03:47 PM Re: RFC on possible new UDF
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, it can be used as UDF as well.
say, as part of the build tools.
_________________________
!

download KiXnet

Top
#154005 - 2005-12-23 04:03 PM Re: RFC on possible new UDF
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Which brings up another point.

The poliferation of UDF's is really great, but searching them can be tedious at times, maybe we can convince Doc to break them into functional area.
_________________________
Today is the tomorrow you worried about yesterday.

Top
#154006 - 2005-12-23 04:10 PM Re: RFC on possible new UDF
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
not sure I understand what you mean.

how would one break a forum into functional areas?
or you talking about the udf CHM?
_________________________
!

download KiXnet

Top
#154007 - 2005-12-23 04:17 PM Re: RFC on possible new UDF
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
no... general topics

File & Disk
String & Array
Math
etc...

Like SL's UDF Lib
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#154008 - 2005-12-23 04:19 PM Re: RFC on possible new UDF
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Didn't have a specific way of doing in mind. Maybe Threads within the UDF forum. Or sections within the CHM, just thinking of way's to break it up a little bit into seperate areas, such as AD functions, File Operations, Script Build, WMI management, etc etc etc.
_________________________
Today is the tomorrow you worried about yesterday.

Top
#154009 - 2005-12-23 04:31 PM Re: RFC on possible new UDF
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
the problem is that it's impossible to maintain.

and rad, what you mean general topics?
SL's udf lib is udf library and it's not based on forum software.
thus, it's hugely controllable.
our lib is flexible but on the otherside without control.
_________________________
!

download KiXnet

Top
#154010 - 2006-01-03 09:42 AM Re: RFC on possible new UDF
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
I guess the simplest catalogue would be a sticky thread with the UDFs categorised into tables.

The hardest part is finding sufficient volunteers to maintain the pages. It's a boring tedious thankless task.

Maybe it could be included in the forum mirror process - new UDF's are flagged automatically and manually added to a category, then the categorised index page is generated and automatically posted.

Top
#154011 - 2006-01-03 02:31 PM Re: RFC on possible new UDF
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Would it be programatically possible to read part of the first message in the thread (that is where the UDF is supposed to be) and require a specific tag line in the text body of the message that then could be used to catagorize them automagically?

Ex: Catagory = Script Generation

With that being the first line in the body of the message, and have a preset list, and make it part of the requirements for posting.
_________________________
Today is the tomorrow you worried about yesterday.

Top
#154012 - 2006-01-03 02:49 PM Re: RFC on possible new UDF
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, we can make a rule that it must be but like said, it's hell of job to go changing all of the old UDF's which don't have no tag line.
then, forcing any tag lines is not that simple either.

and one more, who gets to decide the categories?
_________________________
!

download KiXnet

Top
#154013 - 2006-01-03 05:15 PM Re: RFC on possible new UDF
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
As for who decides, my vote would be with the moderators, since they are the ones that have to manage it as it is now.
_________________________
Today is the tomorrow you worried about yesterday.

Top
#154014 - 2006-01-03 05:22 PM Re: RFC on possible new UDF
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Yes, for old posts, if the posters don't edit, i'd let the mods decide.
For new posts there should be then an enhancement in the guidelines with predefined categories the udf must be posted with (categories to be decided).

But to be honest ... I'm afraid I won't crawl through 563 (-2) threads and edit for category, at least not for this paycheck
_________________________



Top
#154015 - 2006-01-03 07:57 PM Re: RFC on possible new UDF
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
The idea is good Gargoyle, however as Jochen and others say the implementation and continued management is a LONG thankless task that I doubt anyone wants to spend that much time on. Many of these UDFs could/would possibly fit into multiple categories so then what? An arbitration council? Then each one of those in question would possibly take from a day to a week to agree upon (if at all) so if say 100 UDFs fell into that category it could potentially takes months to even get to an agreement point for all of them.

ScriptLogic doesn't have that issue because from what I can tell there is one person in charge so it goes where he says and he is PAID to do it

Top
#154016 - 2006-01-03 08:09 PM Re: RFC on possible new UDF
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
It was worth the point of consideration at least.

I know that the Mods are handsomely rewarded for the duties that they perform here with the gratitude and thanks from all of us others that use and abuse you knowledge and widsom.

So with that said, I will just keep doing searches through the UDF forum and give it my best shot...
_________________________
Today is the tomorrow you worried about yesterday.

Top
#154017 - 2006-01-03 09:14 PM Re: RFC on possible new UDF
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
could go searching in the UDF listing instead.
the forum is known to be hard to crawl.
_________________________
!

download KiXnet

Top
Page 1 of 1 1


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

Who's Online
0 registered and 918 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.073 seconds in which 0.028 seconds were spent on a total of 12 queries. Zlib compression enabled.

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