forum.vdsworld.com

Author Message
geicsge
Newbie

Joined: 27 Feb 2009
Posts: 18

Posted: Sat Oct 03, 2009 10:38 pm    Post subject: @regread error

A real example:

 Code: info @regtype(HLM,SOFTWARE\Classes\CLSID\{0AFACED1-E828-11D1-9187-B532F1E9575D}\ShellFolder,CallForAttributes)

is INTEGER, ok...

 Code: info @regread(HLM,SOFTWARE\Classes\CLSID\{0AFACED1-E828-11D1-9187-B532F1E9575D}\ShellFolder,CallForAttributes)

returns -268435456

it is INCORECT -> It must return 4026531840 -> F0000000

Integers larger than 2G become negative (a Delphi/VDS issue).

A "SOFTWARE" SOLUTION FOR THE INTEGER VALUES RETURNED BY @REGREAD() FUNCTION:

FFFFFFFF = 4294967295 = @sum(\$FFFFFFFF) -> @regread() = -1 !
FFFFFFFE = 4294967294 = @sum(\$FFFFFFFE) -> @regread() = -2 !
.................................................................................................

So, the solution:

 Code: %s =@regread(%a,%b,%c) if @less(%s,0)     %s =@sum(4294967295,1,%s) end

Cool?
DaveR
Valued Contributor

Joined: 03 Sep 2005
Posts: 412
Location: Australia

Posted: Wed Oct 07, 2009 11:21 am    Post subject: Re: @regread error

geicsge wrote:
So, the solution:

 Code: %s =@regread(%a,%b,%c) if @less(%s,0)     %s =@sum(4294967295,1,%s) end

Cool?

Yes, and no. It only works if the integer, or file size, is between 2147483648 and 4294967295. There's no way to tell if the integer is supposed to be larger than 4294967295, so no way to know if you need to add 4294967295 or 6442450944, or 8589934590 etc.

_________________
cheers

Dave
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT Page 1 of 1

 Jump to: Select a forum Website Information----------------News/AnnouncementsTerms of UseProduct Support Discussion Forums----------------General HelpWish ListBug ReportsMiscellaneousMultilingual HelpOther Product Support/Announcements Share Source Code----------------Visual DialogScript Open Source ProjectsVisual DialogScript 2 Source CodeVisual DialogScript 3 Source CodeVisual DialogScript 4 Source CodeVisual DialogScript 5 Source CodeVisual DialogScript 5 UnitsVisual DialogScript 6 Source CodeVisual DialogScript 6 Units Advanced Discussion Forums----------------Advanced Help for VDS 5 & UpAdvanced Wish ListAdvanced Bug ReportsAdvanced VDS 5 Source CodeAdvanced VDS 6 Source Code Resources----------------Visual DialogScript Web SitesResourcesKnowledge Base
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

@vdsworld

Powered by phpBB © 2001, 2005 phpBB Group