i made a little tool to calulate the memoery comsumption of a array (muilt dimentional too)
ok it updated
Code: Select all
;*****************************************
;*Name: Array Memory Usage Calulator *
;*By: Dreglor *
;*last updated: 9-21-03 9:32pm *
;*****************************************
OpenConsole()
ConsoleTitle("Array Memory Usage Calulator")
start:
Print("Enter the number of dimentions: ")
dimentions=Val(Input())
PrintN("")
Dim dsize(dimentions)
For i=1 To dimentions
Print("Enter "+Str(i)+"D's size: ")
dsize(i)=Val(Input())
PrintN("")
Next i
Print("Enter the data type(use b,w,l,f,s): ")
dtype.s=Input()
PrintN("")
memsize=dsize(1)
For i=2 To dimentions
memsize=memsize*dsize(i)
Next i
If dtype="b" Or dtype="B"
memsize=memsize*1
EndIf
If dtype="w" Or dtype="W"
memsize=memsize*2
EndIf
If dtype="l" Or dtype="f" Or dtype="s" Or dtype="L" Or dtype="F" Or dtype="S"
memsize=memsize*4
EndIf
PrintN("The array will consume: "+Str(memsize)+" of Bytes")
PrintN("OR: "+StrF(memsize/1024)+" of Kilobytes")
PrintN("OR: "+StrF(memsize/1048576)+" of Megabytes")
PrintN("OR: "+StrF(memsize/1073741824)+" of Gigabytes")
Print("want to calulate again?(Y/N) ")
yn.s=Input()
ClearConsole()
If yn="Y" Or yn="y"
Goto start
ElseIf yn="N" Or "n"
End
Else
End
EndIf


