Jump to content

Recommended Posts


First off, great work on SMS, feels natural coming from delphi and looks to have a lot of potential.


My question:

Does SMS support Byte(normally in the System unit), if so, is there a Unit I need to include ?


Otherwise, how and where could I declare it as a custom type ?


Many thanks



Link to post
Share on other sites

I'm no expert with SmartMS (just using it by myself for 2 days), but I would guess that a byte type is not necessary with JavaScript, as it will be translated to an integer type anyway. Thus the benefit of little memory overhead as in a compiled project does not really exists and thus there is no need for a byte type.


However, in case you want to use a byte due to the nice wrap around effect at $FF you would need to and your integer variable to mimic that effect.


For example:


i := (i + 1) and $FF; // limit i to byte values

Link to post
Share on other sites

CWBudde is correct. Javascript does not support single byte datatypes.

You can however allocate a native array with UINT8/16/32 but those are usually used with buffers (see w3buffers.pas)


If you are processing a large number of bytes, then using a buffer would be faster.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...