1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-03 11:11:20 +00:00

Revert latest changes to SUBs sorting.

64 bit systems don't handle it at all. Will only be available in Windows and Linux 32bit.
This commit is contained in:
FellippeHeitor 2016-01-15 22:09:49 -02:00
parent d86b5c84b6
commit 7db635a043

View file

@ -7272,16 +7272,14 @@ END IF
'-------- init -------- '-------- init --------
ly$ = MKL$(1) ly$ = MKL$(1)
lySorted$ = ly$
CurrentlyViewingWhichSUBFUNC = 1 CurrentlyViewingWhichSUBFUNC = 1
PreferCurrentCursorSUBFUNC = 0 PreferCurrentCursorSUBFUNC = 0
InsideDECLARE = 0 InsideDECLARE = 0
FoundExternalSUBFUNC = 0 FoundExternalSUBFUNC = 0
l$ = ideprogname$ l$ = ideprogname$
IF l$ = "" THEN l$ = "Untitled" + tempfolderindexstr$ IF l$ = "" THEN l$ = "Untitled" + tempfolderindexstr$
IF INSTR(_OS$, "WIN") > 0 OR (INSTR(_OS$, "LINUX") > 0 AND INSTR(_OS$, "32BIT") > 0) THEN
lySorted$ = ly$
lSorted$ = l$ lSorted$ = l$
END IF
TotalSUBs = 0 TotalSUBs = 0
SortedSubsFlag = idesortsubs SortedSubsFlag = idesortsubs
@ -7356,15 +7354,16 @@ FOR y = 1 TO iden
END IF END IF
l$ = l$ + sep + chr$(195) + chr$(196) + n$ + " " + sf$ + args$ l$ = l$ + sep + chr$(195) + chr$(196) + n$ + " " + sf$ + args$
IF INSTR(_OS$, "WIN") > 0 OR (INSTR(_OS$, "LINUX") > 0 AND INSTR(_OS$, "32BIT") > 0) THEN
'Populate SortedSubsList() 'Populate SortedSubsList()
TotalSUBs = TotalSUBs + 1 TotalSUBs = TotalSUBs + 1
ListItemLength = LEN(n$ + " " + sf$ + args$) ListItemLength = LEN(n$ + " " + sf$ + args$)
REDIM _PRESERVE SortedSubsList(1 to TotalSUBs) as string * 998 REDIM _PRESERVE SortedSubsList(1 to TotalSUBs) as string * 998
SortedSubsList(TotalSUBs) = n$ + " " + sf$ + args$ REDIM _PRESERVE CaseBkpSubsList(1 to TotalSUBs) as string * 998
CaseBkpSubsList(TotalSUBs) = n$ + " " + sf$ + args$
SortedSubsList(TotalSUBs) = UCASE$(CaseBkpSubsList(TotalSUBs))
MID$(CaseBkpSubsList(TotalSUBs), 992, 6) = MKL$(y) + MKI$(ListItemLength)
MID$(SortedSubsList(TotalSUBs), 992, 6) = MKL$(y) + MKI$(ListItemLength) MID$(SortedSubsList(TotalSUBs), 992, 6) = MKL$(y) + MKI$(ListItemLength)
END IF END IF
END IF
NEXT NEXT
FOR x = LEN(l$) TO 1 STEP -1 FOR x = LEN(l$) TO 1 STEP -1
@ -7372,27 +7371,29 @@ FOR x = LEN(l$) TO 1 STEP -1
IF a$ = chr$(195) THEN MID$(l$, x, 1) = chr$(192): EXIT FOR IF a$ = chr$(195) THEN MID$(l$, x, 1) = chr$(192): EXIT FOR
NEXT NEXT
IF INSTR(_OS$, "WIN") > 0 OR (INSTR(_OS$, "LINUX") > 0 AND INSTR(_OS$, "32BIT") > 0) THEN
if TotalSUBs > 1 then if TotalSUBs > 1 then
DIM m as _MEM DIM m as _MEM
m = _MEM(SortedSubsList()) m = _MEM(SortedSubsList())
Sort m 'Steve's sorting routine IF INSTR(_OS$, "64BIT") = 0 THEN Sort m 'Steve's sorting routine
FOR x = 1 to TotalSUBs FOR x = 1 to TotalSUBs
ListItemLength = CVI(MID$(SortedSubsList(x), LEN(SortedSubsList(x)) - 2, 2)) ListItemLength = CVI(MID$(SortedSubsList(x), LEN(SortedSubsList(x)) - 2, 2))
lySorted$ = lySorted$ + MID$(SortedSubsList(x), LEN(SortedSubsList(x)) - 6, 4) lySorted$ = lySorted$ + MID$(SortedSubsList(x), LEN(SortedSubsList(x)) - 6, 4)
lSorted$ = lSorted$ + sep + chr$(195) + chr$(196) + left$(SortedSubsList(x), ListItemLength) for RestoreCaseBkp = 1 to TotalSUBs
IF MID$(SortedSubsList(x), LEN(SortedSubsList(x)) - 6, 4) = MID$(CaseBkpSubsList(RestoreCaseBkp), LEN(CaseBkpSubsList(RestoreCaseBkp)) - 6, 4) THEN
lSorted$ = lSorted$ + sep + chr$(195) + chr$(196) + left$(CaseBkpSubsList(RestoreCaseBkp), ListItemLength)
EXIT FOR
END IF
next
NEXT NEXT
FOR x = LEN(lSorted$) TO 1 STEP -1 FOR x = LEN(lSorted$) TO 1 STEP -1
a$ = MID$(lSorted$, x, 1) a$ = MID$(lSorted$, x, 1)
IF a$ = chr$(195) THEN MID$(lSorted$, x, 1) = chr$(192): EXIT FOR IF a$ = chr$(195) THEN MID$(lSorted$, x, 1) = chr$(192): EXIT FOR
NEXT NEXT
SortedSubsFlag = idesortsubs
else else
SortedSubsFlag = 0 'Override idesortsubs if the current program doesn't have more than 1 subprocedure SortedSubsFlag = 0 'Override idesortsubs if the current program doesn't have more than 1 subprocedure
end if end if
ELSE
SortedSubsFlag = 0
END IF
'72,19 '72,19
i = 0 i = 0
@ -7437,8 +7438,7 @@ o(i).y = idewy + idesubwindow - 6
o(i).txt = idenewtxt("#Edit" + sep + "#Cancel") o(i).txt = idenewtxt("#Edit" + sep + "#Cancel")
o(i).dft = 1 o(i).dft = 1
IF INSTR(_OS$, "WIN") > 0 OR (INSTR(_OS$, "LINUX") > 0 AND INSTR(_OS$, "32BIT") > 0) THEN If TotalSUBs > 1 AND INSTR(_OS$, "64BIT") = 0 then
If TotalSUBs > 1 then
i = i + 1 i = i + 1
o(i).typ = 4 'check box o(i).typ = 4 'check box
o(i).x = idewx - 22 o(i).x = idewx - 22
@ -7446,7 +7446,6 @@ IF INSTR(_OS$, "WIN") > 0 OR (INSTR(_OS$, "LINUX") > 0 AND INSTR(_OS$, "32BIT")
o(i).nam = idenewtxt("#Sorted A-Z") o(i).nam = idenewtxt("#Sorted A-Z")
o(i).sel = SortedSubsFLAG o(i).sel = SortedSubsFLAG
END IF END IF
END IF
'-------- end of init -------- '-------- end of init --------
@ -11532,7 +11531,7 @@ SELECT CASE DataType
o1 = m.OFFSET + (i + gap) * ES o1 = m.OFFSET + (i + gap) * ES
_MEMGET m, o, T7a _MEMGET m, o, T7a
_MEMGET m, o1, T7b _MEMGET m, o1, T7b
IF _STRICMP(T7a, T7b) = 1 THEN IF T7a > T7b THEN
T7c = T7b T7c = T7b
_MEMPUT m, o1, T7a _MEMPUT m, o1, T7a
_MEMPUT m, o, T7c _MEMPUT m, o, T7c