Skip to content

Commit

Permalink
Replace IF Application.Args[1] To Select Case Application.Args[1]
Browse files Browse the repository at this point in the history
  • Loading branch information
eloaders committed Mar 14, 2012
1 parent d33ae2b commit 1eb7e8d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 37 deletions.
4 changes: 2 additions & 2 deletions src/i-nex/.settings
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ SearchComment=False
SearchString=True

[OpenFile]
Active=1
File[1]=".src/Finfosys.form"
File[2]=".src/Finfosys.class:576.23"
File[3]=".src/Global.class:6.65"
Expand All @@ -41,7 +40,8 @@ File[16]=".src/Reportm.module:341.8"
File[17]=".src/FReport_Gen.form"
File[18]=".src/FReport_Gen.class:33.1"
File[19]=".src/Start_App_Args.form"
File[20]=".src/Start_App_Args.class:3.25"
Active=20
File[20]=".src/Start_App_Args.class:8.12"
File[21]=".src/ChkPrm.module:14.3"
File[22]=".src/BIOS_microcode_update_recommended.module:9.96"
File[23]=".src/thermal_zone.module:13.11"
Expand Down
76 changes: 41 additions & 35 deletions src/i-nex/.src/Start_App_Args.class
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,51 @@

Public Sub Form_Open()
Dim S As Boolean = True
If (Application.Args[1] = "--help") Then
Print Application.name & " " & Application.version & " running on:\n\nArchitecture: " & System.Architecture
Print "System Family: " & System.Family & ""
Print "Gambas Version: " & System.FullVersion & ""
Print "System Charset: " & System.Charset & ""
Print "Hostname: " & System.Host & ""
Print ""
Print "Usage: " & Application.name & ".gambas [Options]"
Print "Options:"
Print "--help (Chow Help)"
Print "--about (Show About dialog)"
Print "--gen_report (Show Report dialog)"
S = False
Me.Close
Endif

If (Application.Args[1] = "--about") Then
About.Show
S = False
Me.Close
Endif
Select Case Application.Args[1]

Case "--help"
Print ("" & Application.name & "" & Application.version & " running on:\n\nArchitecture: " & System.Architecture & ""
"\nSystem Family: " & System.Family & ""
"\nGambas Version: " & System.FullVersion & ""
"\nSystem Charset: " & System.Charset & ""
"\nHostname: " & System.Host & ""
"\n"
"\nUsage: " & Application.name & ".gambas [Options]"
"\nOptions:"
"\n--help (Chow Help)"
"\n--about (Show About dialog)"
"\n--gen_report (Show Report dialog)")
S = False
Me.Close

Case "--about"
About.Show
S = False
Me.Close

Case "--gen_report"
Finfosys.Show
Finfosys.Hide
FReport_Gen.Show
S = False
Me.Close

Case Null
Finfosys.Show
S = False
Me.Close

If (Application.Args[1] = "--gen_report") Then
Finfosys.Show
Finfosys.Hide
FReport_Gen.Show
S = False
Me.Close
Endif

If (Application.Args[1] = Null) Then
Finfosys.Show
S = False
Me.Close
Endif
End Select

If S = True Then
Message.Warning("Bad Arguments!!\nUsage: i-nex.gambas [Options]\nOptions:\n--help (Chow Help)\n--about (Show About dialog)\n--gen_report (Show Report dialog)")
Message.Warning("Bad Arguments!!\n"
"Usage: i-nex.gambas [Options]\n"
"Options:\n"
"--help (Chow Help)\n"
"--about (Show About dialog)\n"
"--gen_report (Show Report dialog)")
Me.Close
Endif

End
End

0 comments on commit 1eb7e8d

Please sign in to comment.