moving more from Console to Terminal Internal/External Apps

This commit is contained in:
EverythingWindows 2022-11-14 12:11:31 +07:00
parent 5fe61b8fe4
commit b37a6e60c9
5 changed files with 92 additions and 61 deletions

View file

@ -131,42 +131,7 @@ Public Class Console
AdvancedCommand = False
BadCommand = False
Case "date"
If Strings.AvailableFeature(24) = 1 Then
NewLine("The date is " & Date.Now.DayOfYear & " days since the first day of the year")
AdvancedCommand = False
BadCommand = False
ElseIf Strings.AvailableFeature(24) = 3 Then
If Strings.AvailableFeature(25) = 1 Then
Dim TheWeek As String = Date.Now.DayOfYear / 7
NewLine("The date is " & TheWeek.Substring(0, 2) & " weeks since the first week of the year")
AdvancedCommand = False
BadCommand = False
ElseIf Strings.AvailableFeature(25) = 3 Then
If Strings.AvailableFeature(26) = 1 Then
NewLine("The date is " & Date.Now.Month & " months since the first month of the year")
AdvancedCommand = False
BadCommand = False
ElseIf Strings.AvailableFeature(26) = 3 Then
If Strings.AvailableFeature(27) = 1 Then
NewLine("The year is " & Date.Now.Year)
AdvancedCommand = False
BadCommand = False
ElseIf Strings.AvailableFeature(27) = 3 Then
If Strings.AvailableFeature(28) = 1 Then
NewLine("The date is " & Date.Now.Day & "/" & Date.Now.Month)
AdvancedCommand = False
BadCommand = False
ElseIf Strings.AvailableFeature(28) = 3 Then
If Strings.AvailableFeature(29) = 1 Then
NewLine("The date is " & Date.Now.Day & "/" & Date.Now.Month & "/" & Date.Now.Year)
AdvancedCommand = False
BadCommand = False
End If
End If
End If
End If
End If
End If
DateTerm()
Case "dir"
If Strings.AvailableFeature(16) = "1" Then
TerminalDirectories(CurrentDirectory)
@ -240,27 +205,7 @@ Public Class Console
BadCommand = False
End If
Case "time"
If Strings.AvailableFeature(5) = "1" Then
NewLine(Math.Floor(Date.Now.Subtract(Date.Today).TotalSeconds) & " seconds passed since midnight")
ElseIf Strings.AvailableFeature(5) = "3" Then
If Strings.AvailableFeature(6) = "1" Then
NewLine(Math.Floor(Date.Now.Subtract(Date.Today).TotalMinutes) & " minutes passed since midnight")
ElseIf Strings.AvailableFeature(6) = "3" Then
If Strings.AvailableFeature(7) = "1" Then
NewLine(Math.Floor(Date.Now.Subtract(Date.Today).TotalHours) & " hours passed since midnight")
ElseIf Strings.AvailableFeature(7) = "3" Then
If Strings.AvailableFeature(12) = "1" Then
If Date.Now.Hour < 12 Then
NewLine("The time is " & TimeOfDay.Hour & " AM")
Else
NewLine("The time is " & TimeOfDay.Hour - 12 & " PM")
End If
ElseIf Strings.AvailableFeature(23) = "1" Then
NewLine("The time is " & TimeOfDay.Hour & ":" & TimeOfDay.Minute)
End If
End If
End If
End If
TimeTerm()
AdvancedCommand = False
BadCommand = False
Case "su"

View file

@ -10,6 +10,7 @@ Public Class ShiftOSMenu
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
CheckInstall()
lbl_BuildString.Text = My.Resources.CurrentVersion
BannerChange.Start()
End Sub

View file

@ -51,7 +51,7 @@
NewLine("(textpad | 100 CP) TextPad")
Else
If Strings.AvailableFeature(30) = "0" Then
NewLine("(script | 100 CP) ShiftOS Batch Script Support")
NewLine("(batchscript | 100 CP) ShiftOS Batch Script Support")
End If
End If
End If
@ -88,6 +88,26 @@
Else
If Strings.AvailableFeature(24) = "0" Then
NewLine("(date | 70 CP) Date command")
Else
If Strings.AvailableFeature(25) = "0" Then
NewLine("(woy | 75 CP) Date by week of year")
Else
If Strings.AvailableFeature(26) = "0" Then
NewLine("(moy | 80 CP) Date by month of year")
Else
If Strings.AvailableFeature(27) = "0" Then
NewLine("(year | 85 CP) Date by year")
Else
If Strings.AvailableFeature(28) = "0" Then
NewLine("(mmyyyy | 90 CP) Date by month and year")
Else
If Strings.AvailableFeature(29) = "0" Then
NewLine("(generaldate | 95 CP) Date by general format")
End If
End If
End If
End If
End If
End If
End If
End If

View file

@ -205,7 +205,7 @@ Module TerminalExternalApps
Select Case GetText
Case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
BC_CurrentNumber = BC_CurrentNumber & GetText
Case "+", "-", "*", "/"
Case "+", "-", "*", "/", "^"
Dim BC_Numbers3 As Integer
Select Case BC_ThriceMoreValue
Case 1
@ -224,7 +224,7 @@ Module TerminalExternalApps
End Select
BC_Operation2 = GetText
Case "."
Console.TextBox1.Text = Console.TextBox1.Text & "Decimals aren't supported yet!"
NewLine("Decimals aren't supported yet!")
Case Else
'BC_Counting(BC_Numbers1, BC_Numbers2, BC_Operation2)
End Select
@ -251,6 +251,8 @@ Module TerminalExternalApps
BC_Result = FirstNum * SecondNum
Case "/"
BC_Result = FirstNum / SecondNum
Case "^"
BC_Result = FirstNum ^ SecondNum
End Select
End Sub

View file

@ -83,6 +83,45 @@
End Select
End Sub
Public Sub DateTerm()
If Strings.AvailableFeature(24) = 1 Then
NewLine("The date is " & Date.Now.DayOfYear & " days since the first day of the year")
AdvancedCommand = False
Console.BadCommand = False
ElseIf Strings.AvailableFeature(24) = 3 Then
If Strings.AvailableFeature(25) = 1 Then
Dim TheWeek As String = Date.Now.DayOfYear / 7
NewLine("The date is " & TheWeek.Substring(0, 2) & " weeks since the first week of the year")
AdvancedCommand = False
Console.BadCommand = False
ElseIf Strings.AvailableFeature(25) = 3 Then
If Strings.AvailableFeature(26) = 1 Then
NewLine("The date is " & Date.Now.Month & " months since the first month of the year")
AdvancedCommand = False
Console.BadCommand = False
ElseIf Strings.AvailableFeature(26) = 3 Then
If Strings.AvailableFeature(27) = 1 Then
NewLine("The year is " & Date.Now.Year)
AdvancedCommand = False
Console.BadCommand = False
ElseIf Strings.AvailableFeature(27) = 3 Then
If Strings.AvailableFeature(28) = 1 Then
NewLine("The date is " & Date.Now.Day & "/" & Date.Now.Month)
AdvancedCommand = False
Console.BadCommand = False
ElseIf Strings.AvailableFeature(28) = 3 Then
If Strings.AvailableFeature(29) = 1 Then
NewLine("The date is " & Date.Now.Day & "/" & Date.Now.Month & "/" & Date.Now.Year)
AdvancedCommand = False
Console.BadCommand = False
End If
End If
End If
End If
End If
End If
End Sub
Public Sub Help()
NewLine("ShiftOS Help Manual")
NewLine(Nothing)
@ -381,4 +420,28 @@
NewLine(" .~?55Y?!^:... ")
NewLine(" .:~~^~^^::. ")
End Sub
Public Sub TimeTerm()
If Strings.AvailableFeature(5) = 1 Then
NewLine(Math.Floor(Date.Now.Subtract(Date.Today).TotalSeconds) & " seconds passed since midnight")
ElseIf Strings.AvailableFeature(5) = 3 Then
If Strings.AvailableFeature(6) = 1 Then
NewLine(Math.Floor(Date.Now.Subtract(Date.Today).TotalMinutes) & " minutes passed since midnight")
ElseIf Strings.AvailableFeature(6) = 3 Then
If Strings.AvailableFeature(7) = 1 Then
NewLine(Math.Floor(Date.Now.Subtract(Date.Today).TotalHours) & " hours passed since midnight")
ElseIf Strings.AvailableFeature(7) = 3 Then
If Strings.AvailableFeature(12) = 1 Then
If Date.Now.Hour < 12 Then
NewLine("The time is " & TimeOfDay.Hour & " AM")
Else
NewLine("The time is " & TimeOfDay.Hour - 12 & " PM")
End If
ElseIf Strings.AvailableFeature(23) = 1 Then
NewLine("The time is " & TimeOfDay.Hour & ":" & TimeOfDay.Minute)
End If
End If
End If
End If
End Sub
End Module