Home

XS03 Script Production Example: Integer to Text

Content outdated

We are in the process of migrating all content to impulse version 2.0.

If you want to convert numerical data into text (e.g. bytes to assembler) , use the following script.


// input: an array of all input signals
// in0: primary input of type ISamplePointer,IReadableSamples
// in1..: additional inputs of type ISamplePointer,IReadableSamples
// out: output signal of type ITextSamplesWriter
// console: console output of type MessageConsoleStream
// iter: iterator of type ISamplesIterator
// progress: progess control of type  IScriptProgress

progress.cont();
while ( iter.hasNext()) {
    var current <:Long:> = iter.next(out);
    if (!input[0].isNone()) {
        switch (input[0].intValue()) {
            case 1:
                txt = "Its1";
                break;
            case 2:
                txt = "Its2";
                break;
            case 4:
                txt = "Its4";
                break;
            default:
                txt = "unknown";
        }
        out.write(current, false, txt);
    }
}
About Signal Scripts Open JavaDoc Reference

Result


toem

technical software and tooling

Company

Contact Us

This email address is being protected from spambots. You need JavaScript enabled to view it.