Restored from previous forum. Originally posted by Rings.
User.s=Space(255)
l.l=255
Result=GetComputerName_(User,@l)
Info.s
Info="Computername:"+Left(User,l)+Chr(13)
User.s=Space(255)
l.l=255
Result=GetUserName_(User,@l)
Info=Info+"User:"+StripTrail(User)+Chr(13)
lpRootPathName.s="C:\"
pVolumeNameBuffer.s=Space(256)
nVolumeNameSize.l=256
lpVolumeSerialNumber.l
lpMaximumComponentLength.l
lpFileSystemFlags.l
lpFileSystemNameBuffer.s=Space(256)
nFileSystemNameSize.l=256
Result=GetVolumeInformation_(lpRootPathName,pVolumeNameBuffer,256,@lpVolumeSerialNumber,@lpMaximumComponentLength,@lpFileSystemFlags,lpFileSystemNameBuffer,256)
Info=Info + "ID="+Hex(lpVolumeSerialNumber)+Chr(13)
Info=Info +"VolumeName:"+StripTrail(pVolumeNameBuffer) +Chr(13)
Info=Info + "Filesystem:"+StripTrail(lpFileSystemNameBuffer)
MessageRequester("HardDisk Info",Info,0)
Getting better with a little help from my friends....thx Siggi
GetHardDiskInfo
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by TronDoc.
I appreciate the efforts of you folks
writing the user-defined libraries, but I'd
really like to be able to write programs in
plain PureBASIC.
can I replace:
User.s=Space(255)
with something like:
User.s=chr$(32)
for n = 1 to 254
User.s = User.s + chr$(32)
next n
?????????
Joe
elecTRONics DOCtor
{registeredPB}
I appreciate the efforts of you folks
writing the user-defined libraries, but I'd
really like to be able to write programs in
plain PureBASIC.
can I replace:
User.s=Space(255)
with something like:
User.s=chr$(32)
for n = 1 to 254
User.s = User.s + chr$(32)
next n
?????????
Joe
elecTRONics DOCtor
{registeredPB}
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Pupil.
Yes that should work also, another method is to dim an array of bytes like this:can I replace:
User.s=Space(255)Code: Select all
with something like: User.s=chr$(32) for n = 1 to 254 User.s = User.s + chr$(32) next n
Code: Select all
dim User.b(255)
l.l=255
Result=GetComputerName_(@User(0),@l)
Info.s="Computername:"+StripTrail(PeekS(@User(0))
...
end
; another version of the above could be:
Structure buffertype
char.b[255]
EndStructure
User.buffertype
l.l=SizeOf(buffertype)
Result=GetComputerName_(User,@l)
Info.s="Computername:"+StripTrail(PeekS(User))
...
End
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by TronDoc.
kool..thank you.
here is the "space" procedure I came
up with (it even works!)
kool..thank you.
here is the "space" procedure I came
up with (it even works!)
Code: Select all
Procedure.s Spc(length.l) ;define the proc with arguments
;TronDoc's version
User.s=Chr(32) ;chr(32) is a space character
For n.l = 1 To length.l-1 ;we've already got one(1) space
User.s = User.s + Chr(32) ;add enough to make the total we want
Next n
ProcedureReturn User.s ;returns the string of spaces our length
EndProcedure
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
> here is the "space" procedure I came up with (it even works!)
Just be aware that your procedure results in a slightly larger exe than using
the Space() library... for example, your procedure results in an exe of 7712
bytes, but using Space() results in an exe of 7200 bytes. Not much saving, I
agree, but replacing libraries with procedures in a large app makes it all add
up... just something to consider.
PB - Registered PureBasic Coder
Edited by - PB on 12 February 2002 02:49:09
> here is the "space" procedure I came up with (it even works!)
Just be aware that your procedure results in a slightly larger exe than using
the Space() library... for example, your procedure results in an exe of 7712
bytes, but using Space() results in an exe of 7200 bytes. Not much saving, I
agree, but replacing libraries with procedures in a large app makes it all add
up... just something to consider.
PB - Registered PureBasic Coder
Edited by - PB on 12 February 2002 02:49:09
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by TronDoc.
which is why the basics of BASIC need
to be included in PureBASIC before all
of the frills are added to it.
otherwise, before long, we will be having
a dozen people writing libraries with little
or no co-ordinated (with the main PB libs)
version control or more confusion as to
whether a user-lib is required or not....
I could be writing libraries too.
I know asm better than PureBASIC although
I am very rusty at it. -BUT-
I would rather code in PureBASIC because
I like BASIC.
is there no logic in my words?
-jb
RINGS: I apologize for messing up your post.
Thank you for your code. I like it.
elecTRONics DOCtor
{registeredPB}
Edited by - TronDoc on 12 February 2002 03:48:30
which is why the basics of BASIC need
to be included in PureBASIC before all
of the frills are added to it.
otherwise, before long, we will be having
a dozen people writing libraries with little
or no co-ordinated (with the main PB libs)
version control or more confusion as to
whether a user-lib is required or not....
I could be writing libraries too.
I know asm better than PureBASIC although
I am very rusty at it. -BUT-
I would rather code in PureBASIC because
I like BASIC.
is there no logic in my words?
-jb
RINGS: I apologize for messing up your post.
Thank you for your code. I like it.
elecTRONics DOCtor
{registeredPB}
Edited by - TronDoc on 12 February 2002 03:48:30
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Rings.
In my examples i did not look at any size of an exe.
I'm also a VB-Coder , there is no 8 Kbyte exe
Getting better with a little help from my friends....thx Siggi
Thats it.I know 'space' from all Basic-Codes.RINGS: I apologize for messing up your post.
Thank you for your code. I like it.
Edited by - TronDoc on 12 February 2002 03:48:30
In my examples i did not look at any size of an exe.
I'm also a VB-Coder , there is no 8 Kbyte exe

Getting better with a little help from my friends....thx Siggi