mirror of
https://github.com/FellippeHeitor/InForm.git
synced 2025-01-15 03:49:56 +00:00
Add Option _ExplicitArray to sources
This commit is contained in:
parent
2719b4801a
commit
72368e2ca2
7 changed files with 103 additions and 92 deletions
|
@ -1,4 +1,5 @@
|
||||||
Option _Explicit
|
Option _Explicit
|
||||||
|
Option _ExplicitArray
|
||||||
|
|
||||||
$ExeIcon:'.\resources\InForm.ico'
|
$ExeIcon:'.\resources\InForm.ico'
|
||||||
|
|
||||||
|
@ -5352,3 +5353,4 @@ Function OutsideQuotes%% (text$, position As Long)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
'$include:'InForm.ui'
|
'$include:'InForm.ui'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
Option _Explicit
|
Option _Explicit
|
||||||
|
Option _ExplicitArray
|
||||||
|
|
||||||
Dim Shared UiEditorPID As Long, ExeIcon As Long
|
Dim Shared UiEditorPID As Long, ExeIcon As Long
|
||||||
Dim Shared AutoNameControls As _Byte
|
Dim Shared AutoNameControls As _Byte
|
||||||
|
@ -3990,3 +3991,4 @@ Function LoadEditorImage& (FileName$)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
'$include:'InForm.ui'
|
'$include:'InForm.ui'
|
||||||
|
|
||||||
|
|
|
@ -1,63 +1,63 @@
|
||||||
FUNCTION Download$ (url$, file$, timelimit) STATIC
|
Function Download$ (url$, file$, timelimit) Static
|
||||||
'as seen on http://www.qb64.org/wiki/Downloading_Files
|
'as seen on http://www.qb64.org/wiki/Downloading_Files
|
||||||
'adapted for use with InForm
|
'adapted for use with InForm
|
||||||
|
|
||||||
DIM theClient AS LONG, l AS LONG
|
Dim theClient As Long, l As Long
|
||||||
DIM prevUrl$, prevUrl2$, url2$, x AS LONG
|
Dim prevUrl$, prevUrl2$, url2$, x As Long
|
||||||
DIM e$, url3$, x$, t!, a2$, a$, i AS LONG
|
Dim e$, url3$, x$, t!, a2$, a$, i As Long
|
||||||
DIM i2 AS LONG, i3 AS LONG, d$, fh AS LONG
|
Dim i2 As Long, i3 As Long, d$, fh As Long
|
||||||
|
|
||||||
IF url$ <> prevUrl$ OR url$ = "" THEN
|
If url$ <> prevUrl$ Or url$ = "" Then
|
||||||
prevUrl$ = url$
|
prevUrl$ = url$
|
||||||
IF url$ = "" THEN
|
If url$ = "" Then
|
||||||
IF theClient THEN CLOSE theClient: theClient = 0
|
If theClient Then Close theClient: theClient = 0
|
||||||
EXIT SUB
|
Exit Function
|
||||||
END IF
|
End If
|
||||||
url2$ = url$
|
url2$ = url$
|
||||||
x = INSTR(url2$, "/")
|
x = InStr(url2$, "/")
|
||||||
IF x THEN url2$ = LEFT$(url$, x - 1)
|
If x Then url2$ = Left$(url$, x - 1)
|
||||||
IF url2$ <> prevUrl2$ THEN
|
If url2$ <> prevUrl2$ Then
|
||||||
prevUrl2$ = url2$
|
prevUrl2$ = url2$
|
||||||
IF theClient THEN CLOSE theClient: theClient = 0
|
If theClient Then Close theClient: theClient = 0
|
||||||
theClient = _OPENCLIENT("TCP/IP:80:" + url2$)
|
theClient = _OpenClient("TCP/IP:80:" + url2$)
|
||||||
IF theClient = 0 THEN Download = MKI$(2): prevUrl$ = "": EXIT FUNCTION
|
If theClient = 0 Then Download = MKI$(2): prevUrl$ = "": Exit Function
|
||||||
END IF
|
End If
|
||||||
e$ = CHR$(13) + CHR$(10) ' end of line characters
|
e$ = Chr$(13) + Chr$(10) ' end of line characters
|
||||||
url3$ = RIGHT$(url$, LEN(url$) - x + 1)
|
url3$ = Right$(url$, Len(url$) - x + 1)
|
||||||
x$ = "GET " + url3$ + " HTTP/1.1" + e$
|
x$ = "GET " + url3$ + " HTTP/1.1" + e$
|
||||||
x$ = x$ + "Host: " + url2$ + e$ + e$
|
x$ = x$ + "Host: " + url2$ + e$ + e$
|
||||||
PUT #theClient, , x$
|
Put #theClient, , x$
|
||||||
t! = TIMER ' start time
|
t! = Timer ' start time
|
||||||
END IF
|
End If
|
||||||
|
|
||||||
GET #theClient, , a2$
|
Get #theClient, , a2$
|
||||||
a$ = a$ + a2$
|
a$ = a$ + a2$
|
||||||
i = INSTR(a$, "Content-Length:")
|
i = InStr(a$, "Content-Length:")
|
||||||
IF i THEN
|
If i Then
|
||||||
i2 = INSTR(i, a$, e$)
|
i2 = InStr(i, a$, e$)
|
||||||
IF i2 THEN
|
If i2 Then
|
||||||
l = VAL(MID$(a$, i + 15, i2 - i - 14))
|
l = Val(Mid$(a$, i + 15, i2 - i - 14))
|
||||||
i3 = INSTR(i2, a$, e$ + e$)
|
i3 = InStr(i2, a$, e$ + e$)
|
||||||
IF i3 THEN
|
If i3 Then
|
||||||
i3 = i3 + 4 'move i3 to start of data
|
i3 = i3 + 4 'move i3 to start of data
|
||||||
IF (LEN(a$) - i3 + 1) = l THEN
|
If (Len(a$) - i3 + 1) = l Then
|
||||||
d$ = MID$(a$, i3, l)
|
d$ = Mid$(a$, i3, l)
|
||||||
fh = FREEFILE
|
fh = FreeFile
|
||||||
OPEN file$ FOR OUTPUT AS #fh: CLOSE #fh 'Warning! Clears data from existing file
|
Open file$ For Output As #fh: Close #fh 'Warning! Clears data from existing file
|
||||||
OPEN file$ FOR BINARY AS #fh
|
Open file$ For Binary As #fh
|
||||||
PUT #fh, , d$
|
Put #fh, , d$
|
||||||
CLOSE #fh
|
Close #fh
|
||||||
Download = MKI$(1) + MKL$(l) 'indicates download was successful
|
Download = MKI$(1) + MKL$(l) 'indicates download was successful
|
||||||
prevUrl$ = ""
|
prevUrl$ = ""
|
||||||
prevUrl2$ = ""
|
prevUrl2$ = ""
|
||||||
a$ = ""
|
a$ = ""
|
||||||
CLOSE theClient
|
Close theClient
|
||||||
theClient = 0
|
theClient = 0
|
||||||
EXIT FUNCTION
|
Exit Function
|
||||||
END IF ' availabledata = l
|
End If ' availabledata = l
|
||||||
END IF ' i3
|
End If ' i3
|
||||||
END IF ' i2
|
End If ' i2
|
||||||
END IF ' i
|
End If ' i
|
||||||
IF TIMER > t! + timelimit THEN CLOSE theClient: theClient = 0: Download = MKI$(3): prevUrl$ = "": EXIT FUNCTION
|
If Timer > t! + timelimit Then Close theClient: theClient = 0: Download = MKI$(3): prevUrl$ = "": Exit Function
|
||||||
Download = MKI$(0) 'still working
|
Download = MKI$(0) 'still working
|
||||||
END FUNCTION
|
End Function
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
'-----------------------------------------------------------
|
'-----------------------------------------------------------
|
||||||
|
|
||||||
': Controls' IDs: ------------------------------------------------------------------
|
': Controls' IDs: ------------------------------------------------------------------
|
||||||
DIM SHARED gifplaySample AS LONG
|
Dim Shared gifplaySample As Long
|
||||||
DIM SHARED PictureBox1 AS LONG
|
Dim Shared PictureBox1 As Long
|
||||||
DIM SHARED LoadBT AS LONG
|
Dim Shared LoadBT As Long
|
||||||
DIM SHARED PlayBT AS LONG
|
Dim Shared PlayBT As Long
|
||||||
|
|
||||||
': External modules: ---------------------------------------------------------------
|
': External modules: ---------------------------------------------------------------
|
||||||
'$INCLUDE:'gifplay.bi'
|
'$INCLUDE:'gifplay.bi'
|
||||||
|
@ -95,3 +95,4 @@ SUB __UI_FormResized
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
'$INCLUDE:'..\InForm.ui'
|
'$INCLUDE:'..\InForm.ui'
|
||||||
|
|
||||||
|
|
|
@ -5,38 +5,38 @@
|
||||||
'-----------------------------------------------------------
|
'-----------------------------------------------------------
|
||||||
|
|
||||||
': Controls' IDs: ------------------------------------------------------------------
|
': Controls' IDs: ------------------------------------------------------------------
|
||||||
DIM SHARED InFormSetup AS LONG
|
Dim Shared InFormSetup As Long
|
||||||
DIM SHARED PictureBox2 AS LONG
|
Dim Shared PictureBox2 As Long
|
||||||
DIM SHARED InFormresourcesApplicationicon128PX AS LONG
|
Dim Shared InFormresourcesApplicationicon128PX As Long
|
||||||
DIM SHARED InFormLB AS LONG
|
Dim Shared InFormLB As Long
|
||||||
DIM SHARED forQB64LB AS LONG
|
Dim Shared forQB64LB As Long
|
||||||
DIM SHARED ListBox1 AS LONG
|
Dim Shared ListBox1 As Long
|
||||||
DIM SHARED RetryBT AS LONG
|
Dim Shared RetryBT As Long
|
||||||
DIM SHARED CancelBT AS LONG
|
Dim Shared CancelBT As Long
|
||||||
DIM SHARED ActivityIndicator AS LONG
|
Dim Shared ActivityIndicator As Long
|
||||||
|
|
||||||
$VERSIONINFO:FILEVERSION#=0,0,0,1
|
$VersionInfo:FILEVERSION#=0,0,0,1
|
||||||
$VERSIONINFO:PRODUCTVERSION#=0,0,0,7
|
$VersionInfo:PRODUCTVERSION#=0,0,0,7
|
||||||
$VERSIONINFO:CompanyName=Fellippe Heitor
|
$VersionInfo:CompanyName=Fellippe Heitor
|
||||||
$VERSIONINFO:FileDescription=InForm - GUI library for QB64
|
$VersionInfo:FileDescription=InForm - GUI library for QB64
|
||||||
$VERSIONINFO:FileVersion=v0.1
|
$VersionInfo:FileVersion=v0.1
|
||||||
$VERSIONINFO:InternalName=InFormSetup.bas
|
$VersionInfo:InternalName=InFormSetup.bas
|
||||||
$VERSIONINFO:LegalCopyright=Open source
|
$VersionInfo:LegalCopyright=Open source
|
||||||
$VERSIONINFO:OriginalFilename=InFormSetup.exe
|
$VersionInfo:OriginalFilename=InFormSetup.exe
|
||||||
$VERSIONINFO:ProductName=InForm Setup
|
$VersionInfo:ProductName=InForm Setup
|
||||||
$VERSIONINFO:ProductVersion=v0.7
|
$VersionInfo:ProductVersion=v0.7
|
||||||
$VERSIONINFO:Comments=Requires the latest build of QB64
|
$VersionInfo:Comments=Requires the latest build of QB64
|
||||||
$VERSIONINFO:Web=www.qb64.org/inform
|
$VersionInfo:Web=www.qb64.org/inform
|
||||||
|
|
||||||
DIM SHARED binaryExtension$, pathAppend$
|
Dim Shared binaryExtension$, pathAppend$
|
||||||
|
|
||||||
$IF WIN THEN
|
$If WIN Then
|
||||||
binaryExtension$ = ".exe"
|
binaryExtension$ = ".exe"
|
||||||
pathAppend$ = ""
|
pathAppend$ = ""
|
||||||
$ELSE
|
$Else
|
||||||
binaryExtension$ = ""
|
binaryExtension$ = ""
|
||||||
pathAppend$ = "./"
|
pathAppend$ = "./"
|
||||||
$END IF
|
$End If
|
||||||
|
|
||||||
': External modules: ---------------------------------------------------------------
|
': External modules: ---------------------------------------------------------------
|
||||||
'$INCLUDE:'../InForm.bi'
|
'$INCLUDE:'../InForm.bi'
|
||||||
|
@ -1941,3 +1941,4 @@ FUNCTION IconData$
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|
||||||
'$INCLUDE:'../InForm.ui'
|
'$INCLUDE:'../InForm.ui'
|
||||||
|
|
||||||
|
|
|
@ -5,26 +5,26 @@
|
||||||
'-----------------------------------------------------------
|
'-----------------------------------------------------------
|
||||||
|
|
||||||
': Controls' IDs: ------------------------------------------------------------------
|
': Controls' IDs: ------------------------------------------------------------------
|
||||||
DIM SHARED InFormUpdater AS LONG
|
Dim Shared InFormUpdater As Long
|
||||||
DIM SHARED PictureBox2 AS LONG
|
Dim Shared PictureBox2 As Long
|
||||||
DIM SHARED InFormresourcesApplicationicon128PX AS LONG
|
Dim Shared InFormresourcesApplicationicon128PX As Long
|
||||||
DIM SHARED InFormLB AS LONG
|
Dim Shared InFormLB As Long
|
||||||
DIM SHARED forQB64LB AS LONG
|
Dim Shared forQB64LB As Long
|
||||||
DIM SHARED ListBox1 AS LONG
|
Dim Shared ListBox1 As Long
|
||||||
DIM SHARED RetryBT AS LONG
|
Dim Shared RetryBT As Long
|
||||||
DIM SHARED CancelBT AS LONG
|
Dim Shared CancelBT As Long
|
||||||
DIM SHARED ActivityIndicator AS LONG
|
Dim Shared ActivityIndicator As Long
|
||||||
|
|
||||||
DIM SHARED binaryExtension$, pathAppend$
|
Dim Shared binaryExtension$, pathAppend$
|
||||||
DIM SHARED CheckDevUpdates AS _BYTE
|
Dim Shared CheckDevUpdates As _Byte
|
||||||
|
|
||||||
$IF WIN THEN
|
$If WIN Then
|
||||||
binaryExtension$ = ".exe"
|
binaryExtension$ = ".exe"
|
||||||
pathAppend$ = ""
|
pathAppend$ = ""
|
||||||
$ELSE
|
$Else
|
||||||
binaryExtension$ = ""
|
binaryExtension$ = ""
|
||||||
pathAppend$ = "./"
|
pathAppend$ = "./"
|
||||||
$END IF
|
$End If
|
||||||
|
|
||||||
': External modules: ---------------------------------------------------------------
|
': External modules: ---------------------------------------------------------------
|
||||||
'$INCLUDE:'../InForm.bi'
|
'$INCLUDE:'../InForm.bi'
|
||||||
|
@ -418,3 +418,4 @@ SUB __UI_FormResized
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
'$INCLUDE:'../InForm.ui'
|
'$INCLUDE:'../InForm.ui'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
Option _Explicit
|
Option _Explicit
|
||||||
|
Option _ExplicitArray
|
||||||
|
|
||||||
|
$Console:Only
|
||||||
|
_Dest _Console
|
||||||
|
|
||||||
'$INCLUDE:'InFormVersion.bas'
|
'$INCLUDE:'InFormVersion.bas'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue