WOW... I can't believe how much easier this code is... the amazing thing is, both this and the MEMORY UDF use the same .Translated Value, but pull the data together from completely different places within it.
Anyway, might you try this and see if you get a better result for 256MB. Any takers to try it on the GB ranges?
Code:
FUNCTION GETCOMPUTERMEMORY ()
Dim $BaseKey,$RAMTranslated,$RAMAmount
$BaseKey = "HKEY_LOCAL_MACHINE\Hardware\ResourceMap\System Resources\Physical Memory"
$RAMTranslated = RIGHT(READVALUE($BaseKey, ".Translated"), 8)
IF @ERROR=0
$RAMAmount = cdbl((VAL("&"+RIGHT($RAMTranslated,2)+SUBSTR($RAMTranslated,5,2)+SUBSTR($RAMTranslated,3,2)+LEFT($RAMTranslated,2))+16371712.0+1048576.0))/1048576.0
IF ($RAMAmount mod 2)=1
$RAMAmount = $RAMAmount+1.0
ENDIF
$GETCOMPUTERMEMORY = ""+round($RAMAmount)+" MB"
ENDIF
ENDFUNCTION