Skip to content

Porting Scripts to K‐Plus 4

the-j0k3r edited this page Sep 28, 2017 · 1 revision

img-broom Contents of this page may need cleanup or updating.

Preface

This is a quick list of things you should take care of when porting KVS scripts from kvirc3 to K+ 4 We hope that you find this page helpful, but in the event that you have noticed an omission or error, please feel free to edit the page to correct it.

We are always looking for a way to improve our documentation.

Thank you and have fun ;)

The K+ Team

List of function names that have changed:

Old Name New Name Applies to
$setCaption $setWindowTitle widget class
$setIcon $setwindowIcon widget class
$setColStretch $setColumnStretch layout class
$setDisplayStr $displayStr lcd class
$setDisplayInt $displayInt lcd class
$setDisplayDouble $displayDouble lcd class
$setLayoutOrientation $setOrientation groupbox class
$base64ToText $base64ToAscii

Other important changes

  • The widget class does not need anymore the "Customize" flag in $setWFlags()

  • The $time() function has been removed in favour of $date: echo $date("F T",$unixtime)

  • objects.bitBlt has been removed. If you want to paint on a widget, you must do it in its paintEvent using a painter.

  • In $str.replace the order of the 2nd and 3rd parameter has been inverted: Old format: $str.replace(text, replace, search) New format: $str.replace(text, search, replace)

    This can create some bad problem with old scripts trying to trim a string using: echo $str.replace(" the string ", "", " "); In the worst case, this will create an endless loop.

  • Functions with nocase() in the end have been removed. Check their counterpart removing nocase part. e.g.: $str.containsnocase("string","test") will be $str.contains("string","test",true)

⬆️ GOTO TOP

Clone this wiki locally