Skip to content

Commit

Permalink
Fortmatting script from preview window
Browse files Browse the repository at this point in the history
  • Loading branch information
N-thony committed Jan 9, 2025
1 parent b92a357 commit a25a158
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion instat/dlgScript.vb
Original file line number Diff line number Diff line change
Expand Up @@ -675,12 +675,29 @@ Public Class dlgScript
End Sub

Private Sub PreviewScript(strNewScript As String)
txtScript.Text = strNewScript & Environment.NewLine
Dim strScript As String = strNewScript & Environment.NewLine
txtScript.Text = GetFormattedScript(strScript)
txtScript.SelectionStart = txtScript.Text.Length
txtScript.ScrollToCaret()
txtScript.Refresh()
End Sub

Private Function GetFormattedScript(strScript As String) As String
Dim strReconstructedstrScript As String = ""
Dim arrCommentParts As String()
If strScript.Length > 0 Then
arrCommentParts = strScript.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
For Each strPart As String In arrCommentParts
If strReconstructedstrScript = "" Then
strReconstructedstrScript = "" & strPart
Else
strReconstructedstrScript = strReconstructedstrScript & Environment.NewLine & strPart
End If
Next
End If
Return strReconstructedstrScript
End Function

Private Sub ucrInputChooseFile_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputChooseFile.ControlContentsChanged, ucrChkOpenRFile.ControlContentsChanged
UpdateScript()
ucrInputChooseFile.Visible = ucrChkOpenRFile.Checked
Expand Down

0 comments on commit a25a158

Please sign in to comment.