Click here to Skip to main content
15,897,273 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionFTP in vb.net Pin
JollyMansArt1-Oct-09 17:21
JollyMansArt1-Oct-09 17:21 
AnswerRe: FTP in vb.net Pin
Tom Deketelaere1-Oct-09 21:54
professionalTom Deketelaere1-Oct-09 21:54 
AnswerRe: FTP in vb.net Pin
Dave Kreskowiak2-Oct-09 4:00
mveDave Kreskowiak2-Oct-09 4:00 
QuestionDelegates confusion Pin
Sonhospa1-Oct-09 3:11
Sonhospa1-Oct-09 3:11 
AnswerRe: Delegates confusion Pin
Luc Pattyn1-Oct-09 3:44
sitebuilderLuc Pattyn1-Oct-09 3:44 
GeneralRe: Delegates confusion Pin
Sonhospa1-Oct-09 4:22
Sonhospa1-Oct-09 4:22 
GeneralRe: Delegates confusion Pin
Luc Pattyn1-Oct-09 4:34
sitebuilderLuc Pattyn1-Oct-09 4:34 
QuestionNeed help with Parsing Pin
Hawkster181-Oct-09 3:10
Hawkster181-Oct-09 3:10 
Hello everybody,

I need some help with Parsing.
Here what I have to parse. I have to program it in VB MS Access:

'//*/Macro:911;Tests:#ADSLCustomerClass;Generates:146,147
BeginMacro911 ADSL 04 Fehlende Angaben, remplace Macro-326 cye 07.07.2003
Case_#ADSLCustomerClass
"002" : Mtext 146
"2" : Mtext 146
Else: MText 147
EndMacro911

The Real file has like 5000 more of these small texts I have to Parse...this is just 1 of the about 5000

Here what I have to do(I've done 1) and 2) of th first part , just don't know how to continue):

Description:

I need you to write a program using MS-Access which performs the following:

1) Display a “Switchboard” from which to select various functions. The switchboard will start with one button for one function called “Load Mac File”. The switchboard should be opened automatically when the access application is started.
2) Selecting Load Mac File from the switchboard should display a form where the user can browse to the “.mac” file to process.
a. The form should have a scrollable text box in which any progress or error messages are shown.
3) If the chosen .mac file can be opened:
a. Delete the contents of tblLoadableMacros
b. Read through the .mac file, parsing each macro and adding a new record about each to tblLoadableMacros

tblLoadableMacros should have the following fields:

• nID Integer, unique ID field, auto-generated
• nMacroNumber Integer, macro number. Unique value.
• sDescription Memo field. Macro description
• sTests Memo field, lists the values tested by the macro
• sGenerates Memo field, lists the macro text or values generated by the macro
• sMacro Memo field, contains the actual macro script

The attached .mac file is the file we want to parse. It is a text file, can be viewed with Notepad and contains macro script definitions. Here are two example scripts:

'//*/Macro:911;Tests:#ADSLCustomerClass;Generates:146,147
BeginMacro911 ADSL 04 Fehlende Angaben, remplace Macro-326 cye 07.07.2003
Case_#ADSLCustomerClass
"002" : Mtext 146
"2" : Mtext 146
Else: MText 147
EndMacro911


'//*/Macro:912;Tests:#ADSLCustomerClass;Generates:149,150
BeginMacro912 ADSL 01 neu Mindestvertragsdauer, remplace Macro-328 cye 07.07.2003
Case_#ADSLCustomerClass
"002" : Mtext 149
"2" : Mtext 149
Else: MText 150
EndMacro912

In the example of macro 911, your program should perform the following:

1) Read until you find a line which starts with “'//*/Macro:”. From that line of text, do the following:
a. Add a new record to tblLoadableMacros
b. Take the number after //*/Macro: and save it in the new record in nMacroNumber
c. Take the text between “Tests:” and the next semi-colon and store it in sTests. Trim white space.
d. Take the text after “Generates:” up to the end of line and store it in sGenerates. Trim white space.
2) Using the nMacroNumber parsed previously (e.g.: 911), read ahead until you find its BeginMacro line (e.g.: BeginMacro911). From THAT line, if there is any text after the BeginMacro keyword, do the following:
a. Take all text following the keyword (e.g.: BeginMacro911).
b. Remove any leading/trailing white space
c. Store the remaining text in sDescription
3) Scan all lines until you find the matching EndMacro keyword (e.g.: EndMacro912). Everything between (but not including) the BeginMacro and EndMacro lines is stored in sMacro
4) Store the new record.
5) Repeat from 1) until all macros have been read.

You’ll want to show error/progress messages as you go. Some examples:
• Parsing Macro 911…
• Stored Macro 911
• Error storing Macro 911: <error text>
• Did not find matching EndMacro911 keyword
• Warning: Macro 911 has no ‘Tests’ keyword.
• 127 Macros loaded. 5 Errors Encountered.
• Etc.

If someone could please help me I'd be so grateful, If you want to contact me through MSN Messenger (homedog6@hotmail.com) or Yahoo messenger (g_size18@yahoo.de) please ADD ME!

Hope this information helps

Regards Michael
AnswerRe: Need help with Parsing Pin
Luc Pattyn1-Oct-09 3:47
sitebuilderLuc Pattyn1-Oct-09 3:47 
GeneralRe: Need help with Parsing Pin
Hawkster181-Oct-09 3:53
Hawkster181-Oct-09 3:53 
GeneralRe: Need help with Parsing Pin
Hawkster181-Oct-09 3:59
Hawkster181-Oct-09 3:59 
GeneralRe: Need help with Parsing Pin
Luc Pattyn1-Oct-09 4:04
sitebuilderLuc Pattyn1-Oct-09 4:04 
AnswerRe: Need help with Parsing Pin
Dave Kreskowiak1-Oct-09 3:49
mveDave Kreskowiak1-Oct-09 3:49 
GeneralRe: Need help with Parsing Pin
Hawkster181-Oct-09 3:57
Hawkster181-Oct-09 3:57 
GeneralRe: Need help with Parsing Pin
Dave Kreskowiak1-Oct-09 3:59
mveDave Kreskowiak1-Oct-09 3:59 
GeneralRe: Need help with Parsing Pin
Hawkster181-Oct-09 4:04
Hawkster181-Oct-09 4:04 
GeneralRe: Need help with Parsing Pin
Dave Kreskowiak1-Oct-09 4:48
mveDave Kreskowiak1-Oct-09 4:48 
QuestionCopy Fail Pin
Vijjuuu.1-Oct-09 2:21
Vijjuuu.1-Oct-09 2:21 
AnswerRe: Copy Fail Pin
Dave Kreskowiak1-Oct-09 3:43
mveDave Kreskowiak1-Oct-09 3:43 
GeneralRe: Copy Fail Pin
Vijjuuu.1-Oct-09 4:19
Vijjuuu.1-Oct-09 4:19 
QuestionReplicate Application Network Behaviour Pin
phil241530-Sep-09 23:54
phil241530-Sep-09 23:54 
AnswerRe: Replicate Application Network Behaviour Pin
Dave Kreskowiak1-Oct-09 1:16
mveDave Kreskowiak1-Oct-09 1:16 
GeneralRe: Replicate Application Network Behaviour Pin
phil24151-Oct-09 4:17
phil24151-Oct-09 4:17 
GeneralRe: Replicate Application Network Behaviour Pin
Dave Kreskowiak1-Oct-09 8:57
mveDave Kreskowiak1-Oct-09 8:57 
GeneralRe: Replicate Application Network Behaviour Pin
phil24155-Oct-09 3:19
phil24155-Oct-09 3:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.