[SOLVED] VBS-SYNTAX PLEASE HELP

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey for Windows 4.

Moderators: Gurus, Addon Administrators

Erwin Hanzl
Posts: 1189
Joined: Tue Jun 13, 2017 8:47 am
Location: Vienna

[SOLVED] VBS-SYNTAX PLEASE HELP

Post by Erwin Hanzl »

This is the result of my programming experiments with the following code:

ENTRY in VB-Script:
Doc.Add " <h3>"& sVar &" ... "& itm.title &" </h3></span>" 'Number / PlaylistsName
Doc.Add " <h5>"& ExtensionEH &" </h5></span>" 'Extension

ENTRY in style.css:
h3 { font-size:12pt; background:url('commandbar.bmp') padding:0px 0px 20px;} /*for PlaylistsName
h5 { font-size:12pt; padding:0px 0px 0px 300px; } /* für Extension


Image

With which syntax can I extend this second line with the first line so that the extension is always in the same line?
Is there a tabulator function for this?


That's not well:
Doc.Add " <h3>"& sVar &" ... "& itm.title &" __ ." & ExtensionEH &" </h3></span>"

Image


I politely ask for a goal-oriented answer.
Thank you

Google translation
Last edited by Erwin Hanzl on Wed Mar 06, 2019 3:02 pm, edited 2 times in total.
MMW 4.1.31.1919 Gold-Standardinstallation
Peke
Posts: 17446
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: VBS-SYNTAX PLEASE HELP

Post by Peke »

Hi,
Create two functions for Left and Right padding:

Code: Select all

Function Lpad(strInput, length)
  Lpad = Right(space(length) & strInput, length)
end function
Function Rpad(strInput, length)
  Rpad = Left(strInput & Space(length), length)
end function
So you can then use that in your code:

Code: Select all

Doc.Add " <h3>"& sVar &" ... "& Rpad(itm.title,50) & ExtensionEH &" </h3></span>"
But as you use HTML you need to use non-breaking space https://www.w3schools.com/html/html_entities.asp so it complicates things a bit :)

I would rather expand that and fully use CSS FLEXBOX container :) https://css-tricks.com/snippets/css/a-guide-to-flexbox/ and possibly Text Align inside each Flex-Item https://www.computerhope.com/issues/ch001710.htm

Have fun.
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Erwin Hanzl
Posts: 1189
Joined: Tue Jun 13, 2017 8:47 am
Location: Vienna

Re: VBS-SYNTAX PLEASE HELP

Post by Erwin Hanzl »

Hello Pavle,

ich habe deine Function-Code an das Ende des VBScripts hineinkopiert. Mehrmals geprüft und nach MM-Start kommt folgender Fehler:

Image
Last edited by Erwin Hanzl on Thu Mar 07, 2019 1:23 am, edited 2 times in total.
MMW 4.1.31.1919 Gold-Standardinstallation
Peke
Posts: 17446
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: VBS-SYNTAX PLEASE HELP

Post by Peke »

Hi,

That should be "Rpad = Left(strInput & Space(length), length)" instead of "Rpad = Left(strInput & Space(length, length"
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Erwin Hanzl
Posts: 1189
Joined: Tue Jun 13, 2017 8:47 am
Location: Vienna

Re: VBS-SYNTAX PLEASE HELP

Post by Erwin Hanzl »

Hallo Pavle,

danke für die Antwort, aber es fehlt nach wie vor eine schließende Klammer und es kommt zur obigen Fehlermeldung.

Rpad = Left(strInput & Space(length, length)
2 x "("...... aber nur 1 x ")"

Natürlich habe ich alles mehrfach geprüft und auch mit allen Varianten der schließenden Klammer getestet.

Entschuldige, aber es funktioniert mit keiner Variante.
Ich möchte dich nochmals um Prüfung bitten. Danke
Schöne Grüße

Image
MMW 4.1.31.1919 Gold-Standardinstallation
Peke
Posts: 17446
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: VBS-SYNTAX PLEASE HELP

Post by Peke »

Hi,
Sorry, corrected it. It is "Rpad = Left(strInput & Space(length), length)"
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Erwin Hanzl
Posts: 1189
Joined: Tue Jun 13, 2017 8:47 am
Location: Vienna

Re: VBS-SYNTAX PLEASE HELP

Post by Erwin Hanzl »

Hallo Pavle,

danke für Deine rasche Antwort. Jetzt gibt es keine Fehlermeldungen, jedoch komme ich nicht zu meinem gewünschten Ergebnis.

Zusammenfassung:

CODE:

Code: Select all

	   Doc.Add " <h3>"& sVar &" ... "& Rpad(itm.title,50) & ExtensionEH &" </h3></span>"
und

Code: Select all

Function Lpad(strInput, length)
  Lpad = Right(space(length) & strInput, length)
end function

Function Rpad(strInput, length)
   Rpad = Left(strInput & Space(length), length)
end function
Das führt zu folgendem Ergebnis: mp3 sollte rechtsbündig angezeigt werden

Image

Länge von itm.Title=50 (habe ich über eine eigene Ausgabe geprüft) aber anscheinend werden alle Leerzeichen durch "Doc.Add" entfernt.

Ich danke für Deine Bemühungen und werde eben mit diesem Ergebnis leben.

Grüße Erwin
Last edited by Erwin Hanzl on Thu Mar 07, 2019 1:26 am, edited 2 times in total.
MMW 4.1.31.1919 Gold-Standardinstallation
Peke
Posts: 17446
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: VBS-SYNTAX PLEASE HELP

Post by Peke »

Hi,
As I pointed you need to use

Code: Select all

&nbsp; = non-breaking space
instead of single space.

Code: Select all

Function Lpad(strInput, length)
  Lpad = Right(space(length) & strInput, length)
  LPad = Replace(Lpad," ","&nbsp;")
end function

Function Rpad(strInput, length)
   Rpad = Left(strInput & Space(length), length)
   RPad = Replace(Rpad," ","&nbsp;")
end function
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Erwin Hanzl
Posts: 1189
Joined: Tue Jun 13, 2017 8:47 am
Location: Vienna

Re: VBS-SYNTAX PLEASE HELP

Post by Erwin Hanzl »

gelöscht
Last edited by Erwin Hanzl on Wed Mar 06, 2019 2:58 pm, edited 2 times in total.
MMW 4.1.31.1919 Gold-Standardinstallation
Erwin Hanzl
Posts: 1189
Joined: Tue Jun 13, 2017 8:47 am
Location: Vienna

Re: VBS-SYNTAX PLEASE HELP

Post by Erwin Hanzl »

Hallo Pavle, GESCHAFFT

ZUSAMMENFASSUNG: Deine Code

Code: Select all

	   Doc.Add " <h3>"& sVar &" .. "&Rpad(itm.title,20) & ExtensionEH &" </h3></span>"
und

Code: Select all

Function Lpad(strInput, length)
  Lpad = Right(space(length) & strInput, length)
  LPad = Replace(Lpad," ","&nbsp;")
end function

Function Rpad(strInput, length)
   Rpad = Left(strInput & Space(length), length)
   RPad = Replace(Rpad," ","&nbsp;")
end function
im Zusammenhang mit dem Thema "PULSE" -style.css - Schriftart COURIER löst das Problem.

Code: Select all

body { font:12pt Courier, 'Segoe UI', 'Tahoma', Arial, sans serif;
Image

Vielen Dank nochmals für Deine Mühe und Deine Geduld.
Last edited by Erwin Hanzl on Sat Mar 09, 2019 10:08 am, edited 3 times in total.
MMW 4.1.31.1919 Gold-Standardinstallation
Peke
Posts: 17446
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: [SOLVED] VBS-SYNTAX PLEASE HELP

Post by Peke »

Hi,
It was my pleasure.

Do you plan to release full Script or just for you?
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Erwin Hanzl
Posts: 1189
Joined: Tue Jun 13, 2017 8:47 am
Location: Vienna

Re: [SOLVED] VBS-SYNTAX PLEASE HELP

Post by Erwin Hanzl »

Hello Pavle,

da die Software nicht meine Entwicklung ist, steht es mir nicht zu, eine Veröffentlichung durchzuführen. Ich verwende die Weiterentwicklung NUR für mich privat. Deshalb habe ich die Code aus früheren Posts wieder gelöscht.

Es wäre für mich sehr erfreulich, wenn Du meine Idee aufgreifst und diese in einem offiziellem Update zur Verfügung stellen würdest.
Gerne lasse ich Dir bei Bedarf über "Privat Messages" alle Veränderungen zukommen.

Mit freundlichen Grüßen
Erwin

Ich denke, Information ist doch alles. Und das ist wieder gut für die User und damit auch für MediaMonkey.
Image
Last edited by Erwin Hanzl on Sat Mar 09, 2019 10:37 am, edited 1 time in total.
MMW 4.1.31.1919 Gold-Standardinstallation
Peke
Posts: 17446
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: [SOLVED] VBS-SYNTAX PLEASE HELP

Post by Peke »

Hi,
OK, you can send me code and steps to install/setup and I'll create MMIP install.
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Post Reply