Cross Referencer

The forum for all of your Freebasic needs!

Moderators: Pete, Mods

Post Reply
User avatar
Seb McClouth
Veteran
Posts: 342
Joined: Wed Nov 09, 2005 7:47 am
Location: Inside the Matrix...
Contact:

Cross Referencer

Post by Seb McClouth »

Hey

I've took the idea to FreeBasic, and here's the result:

Code: Select all

dim a as integer
dim b as integer
dim count as integer
dim countplace(20) as integer
dim ff as integer
dim map(10,10,10,10) as string
dim n as integer
dim o as integer
dim p as integer
dim q as integer
dim sourcemap as string
dim sourcemapname as string
dim temp as string
dim w as integer
dim x as integer
dim y as integer
dim z as integer

print
print "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
print "Cross Reference builder B-version 0.1.6"
print "- - - - - - - - - - - - - - - - - - - -"
print "(C) Copyright 2008, McClouth Software"
print "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
print
print "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#"
print "STEP 1: Convert to HTML"
print "---------------------------------------"
input "Source code map: ", SourceMap
print "======================================="
print "Creating temporary ServerMap... ";
mkdir "temp"
color 2
print "[DONE]"
color 7
print "======================================="
print "Processing " + SourceMap + "..."
print ".......................................
print "Reading FAT-table:"
color 4
'get SourceMapName
if right$(SourceMap, 1) = "\" then
    SourceMap=Left$(SourceMap, LEN(SourceMap)-1)
end if
count = 0
for a=1 to len(SourceMap)
    if mid$(SourceMap,a,1)= "\" then
        count=count+1
        countplace(count)=a
    end if
next
n=1
o=0
p=0
q=0
SourceMapName=right$(SourceMap,len(SourceMap)-(CountPlace(count)))
map(n,o,p,q)=SourceMapName
print "                " + map(n,o,p,q);:color 7:print "\"
shell "dir /ad /b "+SourceMap +" > temp\"+sourcemapname+".dir"
ff= freefile
open "temp\"+sourcemapname+".dir" for input as #ff
do while not eof(ff)
    input #ff, temp
    o=o+1
    map(n,o,p,q)=temp
loop
close #ff
p=0
for a = 1 to o
    if a = b then p=0
    shell "dir /ad /b "+SourceMap+"\"+map(n,a,0,0)+" > temp\"+map(n,a,0,0)+".dir"
    ff = freefile
    open "temp\"+map(n,a,0,0)+".dir" for input as #ff
        do while not eof(ff)
            input #ff, temp
            p=p+1
            map(n,a,p,0)=temp
        loop
    close #ff
    b=b+1
next a
ff = freefile
open "temp\temp.html" for output as #ff
print o;p;q
print "press any key"
sleep
for w=1 to 20
    for x = 0 to 20
        for y=0 to 20
            color 4
            if map(n,w,x,y) = "" then
                'do nothing
            else
                if (w > 0) then color 5
                if (x > 0 ) then color 6
                if (y > 0 ) then color 7
                print "                "+map(n,w,x,y);:color 7:print "\"
                print #ff, n;",";w;",";x;",";y;" - ";map(n,w,x,y)+"<br>"
            end if
        next
    next
next
close #ff
color 7
print "......................................."
print
print "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#"
print "Press any key..."
sleep
print "Removing temporary ServerMap... ";
kill "temp\*.*"
rmdir "temp"
color 2
print "[DONE]"
color 7
It works on everything so far, but something leaves me clueless, the map-array thing pulls a funny on me, it reproduces maps already in the list on high number, 11 and 15... Can someone help me out here?

Thx
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
Post Reply