Libraryless. Click here for Pure Java version (11535L/64K).
1 | svoid pine_replaceInputDefault(LS tok, S varName, O newDefaultValue) { |
2 | int i = jfind(tok, varName + " = input.<id>("); |
3 | if (i < 0) ret; |
4 | int iOpen = indexOf(tok, "(", i); |
5 | int iDefault = iOpen+2; |
6 | int iEndDefault = indexOfAny(tok, iDefault, ",", ")"); |
7 | replaceTokens_reTok(tok, iDefault, iEndDefault, str(newDefaultValue)); |
8 | } |
download show line numbers debug dex old transpilations
Travelled to 2 computer(s): mqqgnosmbjvj, wnsclhtenguj
No comments. add comment
Snippet ID: | #1037242 |
Snippet name: | pine_replaceInputDefault |
Eternal ID of this version: | #1037242/2 |
Text MD5: | a9b8198c433dafee68a6fe6cfa9c24d3 |
Transpilation MD5: | e3a18e9aa93cb19b30e3ed238a3b5905 |
Author: | stefan |
Category: | javax / pine script |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2023-08-06 15:32:05 |
Source code size: | 339 bytes / 8 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 156 / 221 |
Version history: | 1 change(s) |
Referenced in: | [show references] |