1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-01 11:30:37 +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 lSorted$ = l$
lySorted$ = ly$
lSorted$ = l$
END IF
TotalSUBs = 0 TotalSUBs = 0
SortedSubsFlag = idesortsubs SortedSubsFlag = idesortsubs
@ -7356,14 +7354,15 @@ 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 REDIM _PRESERVE CaseBkpSubsList(1 to TotalSUBs) as string * 998
SortedSubsList(TotalSUBs) = n$ + " " + sf$ + args$ CaseBkpSubsList(TotalSUBs) = n$ + " " + sf$ + args$
MID$(SortedSubsList(TotalSUBs), 992, 6) = MKL$(y) + MKI$(ListItemLength) SortedSubsList(TotalSUBs) = UCASE$(CaseBkpSubsList(TotalSUBs))
END IF MID$(CaseBkpSubsList(TotalSUBs), 992, 6) = MKL$(y) + MKI$(ListItemLength)
MID$(SortedSubsList(TotalSUBs), 992, 6) = MKL$(y) + MKI$(ListItemLength)
END IF END IF
NEXT NEXT
@ -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()) IF INSTR(_OS$, "64BIT") = 0 THEN Sort m 'Steve's sorting routine
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) for RestoreCaseBkp = 1 to TotalSUBs
lSorted$ = lSorted$ + sep + chr$(195) + chr$(196) + left$(SortedSubsList(x), ListItemLength) IF MID$(SortedSubsList(x), LEN(SortedSubsList(x)) - 6, 4) = MID$(CaseBkpSubsList(RestoreCaseBkp), LEN(CaseBkpSubsList(RestoreCaseBkp)) - 6, 4) THEN
NEXT lSorted$ = lSorted$ + sep + chr$(195) + chr$(196) + left$(CaseBkpSubsList(RestoreCaseBkp), ListItemLength)
EXIT FOR
END IF
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
else SortedSubsFlag = idesortsubs
SortedSubsFlag = 0 'Override idesortsubs if the current program doesn't have more than 1 subprocedure else
end if SortedSubsFlag = 0 'Override idesortsubs if the current program doesn't have more than 1 subprocedure
ELSE end if
SortedSubsFlag = 0
END IF
'72,19 '72,19
i = 0 i = 0
@ -7437,15 +7438,13 @@ 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 o(i).y = idewy + idesubwindow - 6
o(i).y = idewy + idesubwindow - 6 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
@ -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