跳轉到內容

Rebol 程式設計/debase

來自華夏公益教科書,開放的書籍,開放的世界
DEBASE value /base base-value 

將字串從不同的進製表示轉換為二進位制。

DEBASE 是一個原生值。

  • -- 要轉換的字串(型別:任何字串)
  • /base -- 允許選擇不同的進位制進行轉換
    • 進位制值 -- 要轉換的進位制:64、16 或 2(型別:任何)

原始碼

[編輯 | 編輯原始碼]
debase: native[
    {Converts a string from a different base representation to binary.} 
    value [any-string!] "The string to convert" 
    /base {Allow a selection of a different base for conversion} 
    base-value "The base to convert from: 64, 16, or 2"
]

華夏公益教科書