Update 2.0
Added ability to convert text to binary & back again.
Thanks to @Italo for encouraging me, I didn't want to do it as it was a little difficult.
More
His encouragement helped
Blocks
Convert Text to binary code.
Triggered when conversion is completed.
-- --
Converts back Binary to regular text.
Triggered when conversion is completed into text.
Downloads
Google Drive - ZIP file
Direct download - BinaryTool (6.8 KB)
Binary Tool AI2 Extension by Xoma (Kumaraswamy) is licensed under CC BY-ND 4.0
(My friend will scold me if the dint't provide link to license. )
Any suggestions or improvements are appreciated!
Thanks
4 Likes
Suggestion: Add a when Error occurred event. It is better than throwing a YailRuntimeError for that.
1 Like
Hey, thanks for the suggestion, but do you know how to do it? I am still learning..
Also why you got that error?
ABG
September 13, 2020, 7:28pm
24
For fast operations like this with one input and one output,
it would be more convenient to offer a block with input and output ports,
like a math block.
Also, offer sample input annd output examples in your tool tip docs.
1 Like
I didn't understand these lines..?
What @ABG mean is you shouldn't use void
, instead you should return something directly.
I don't have any error. I am just suggesting. Use a try-catch
statement to catch the exception error, and use an event block to handle it.
Example:
@SimpleEvent(description = "Raises when error occurred.")
public void ErrorOccurred(String error) {
EventDispatcher.dispatchEvent(this, "ErrorOccurred", error);
}
@SimpleFunction(description = "Integer addition")
public int Addition(int a, int b){
try {
return a + b;
} catch (Exception e) {
ErrorOccurred(e.getMessage());
return 0;
}
}
1 Like
Its throws and error that "catch" without "try"... But the code is all correct
Kumaraswamy:
"catch" without "try"
it means you did not used try statement
1 Like
Ok, lets not go offtopic here... I will learn it later.
this maybe help you Java Exceptions (Try...Catch)
Kumaraswamy:
I will learn it later
as you wish
1 Like
This extension is discontinued :
ɪɴᴛʀᴏᴅᴜᴄɪɴɢ ᴛᴇxᴛᴄᴏɴᴠᴇʀᴛᴇʀ
ᴛᴇxᴛᴄᴏɴᴠᴇʀᴛᴇʀ ɪs ᴀɴ ғʀᴇᴇ ᴇxᴛᴇɴsɪᴏɴ ᴛʜᴀᴛ ᴀʟʟᴏᴡs ᴛᴏ ᴄᴏɴᴠᴇʀᴛ ᴛᴇxᴛ ᴛᴏ ᴅɪғғᴇʀᴇɴᴛ ғᴏʀᴍs.
ᴡʜᴀᴛ ᴛʜɪs ᴄᴀɴ ᴅᴏ?
ᴄᴏɴᴠᴇʀᴛ ᴠᴀʟᴜᴇ ᴛᴏ ʙɪɴᴀʀʏ
ᴄᴏɴᴠᴇʀᴛ ᴠᴀʟᴜᴇ ᴛᴏ ᴏᴄᴛᴀʟ
ᴄᴏɴᴠᴇʀᴛ ᴠᴀʟᴜᴇ ᴛᴏ ʜᴇxᴀᴅᴇᴄɪᴍᴀʟ
ᴄᴜsᴛᴏᴍ ᴅᴇᴄɪᴍᴀʟ ᴄᴏɴᴠᴇʀsɪᴏɴ, ᴄᴏɴᴠᴇʀᴛ ᴅᴇᴄɪᴍᴀʟ ᴛᴏ ᴀɴʏ ᴛʏᴘᴇ ᴏғ ʙᴀsᴇ
& ʙᴀᴄᴋ ᴀɢᴀɪɴ
ʙʟᴏᴄᴋs
[component_method (13)]
ᴄᴏɴᴠᴇʀᴛ ᴛᴇxᴛ ᴛᴏ ʙɪɴᴀʀʏ ᴠᴀʟᴜᴇ
ᴀᴄᴄᴇᴘᴛs : ᴛᴇxᴛ/sᴛʀɪɴɢ
[component_method (14)]
ᴄᴏɴᴠᴇʀᴛ ʙɪɴᴀʀʏ ᴛᴏ ᴛᴇxᴛ ᴠᴀʟᴜᴇ
ᴀᴄᴄᴇᴘᴛs : ᴛᴇxᴛ/sᴛʀɪɴɢ
[component_method (15)]
ᴄᴏɴᴠᴇʀᴛ ᴛᴇxᴛ ᴛᴏ ᴏᴄᴛᴀʟ …