knitr::opts_chunk$set(echo = TRUE, comment='')
The rhli variant of the traditional first program, Hello, World! appears below. To the extent possible, the rhli package exactly replicates the FAME C-HLI interface. For information on parameters and functions, refer to the C-HLI documentation. The C-HLI provides very low level, very complete access to FAME.
C-HLI functions return a status
code to indicate success (zero) or failure. Refer to C HLI Status Codes in the documentation to interpret non-zero status
codes.
| Code | Value | What to do? | |--------|-------|---------------------------------------------------------------------------------------| | HSUCC | 0 | You are good! "Success" | | HNINIT | 2 | The HLI has not been initialized. | | HBPROD | 55 | Contact Qoma, get authorized for Qoma products. | | HLICFL | 98 | Contact FIS, get authorized for FAME products. |
The below program:
These three calls should appear in all C-HLI programs.
# Load the rhli package library("rhli") # Initialize the C-HLI status <- Integer(-1) cfmini(status) cat(sprintf("cfmini(status) status=%d",status$value)) # Get the C-HLI version number ver <- Numeric(-1) cfmver(status,ver) cat(sprintf("cfmver(status,ver) status=%d ver=%.5f",status$value,ver$value)) # Finish the C-HLI cfmfin(status) cat(sprintf("cfmfin(status) status=%d",status$value))
# Say hello! cat(sprintf("\nHello FAME!\n\n %s \"%s\" %s\n rhli version %s\n C-HLI version %.5f\n\n", R.Version()$version.string,R.Version()$nickname,R.Version()$platform, packageVersion("rhli"), ver$value)) # Unload C-HLI shared library # (required for cfmini() to work when building next vignette) unloadNamespace("rhli")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.