[SOLVED] VBS-SYNTAX PLEASE HELP

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

Modérateurs : Gurus, Addon Administrators

Erwin Hanzl
Messages : 1190
Inscription : mar. juin 13, 2017 8:47 am

[SOLVED] VBS-SYNTAX PLEASE HELP

Message par 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
Dernière modification par Erwin Hanzl le mer. mars 06, 2019 3:02 pm, modifié 2 fois.
MMW 4.1.31.1919 Gold-Standardinstallation
Peke
Messages : 18622
Inscription : mar. juin 10, 2003 7:21 pm

Re: VBS-SYNTAX PLEASE HELP

Message par Peke »

Hi,
Create two functions for Left and Right padding:

Code : Tout sélectionner

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 : Tout sélectionner

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
Messages : 1190
Inscription : mar. juin 13, 2017 8:47 am

Re: VBS-SYNTAX PLEASE HELP

Message par 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
Dernière modification par Erwin Hanzl le jeu. mars 07, 2019 1:23 am, modifié 2 fois.
MMW 4.1.31.1919 Gold-Standardinstallation
Peke
Messages : 18622
Inscription : mar. juin 10, 2003 7:21 pm

Re: VBS-SYNTAX PLEASE HELP

Message par 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
Messages : 1190
Inscription : mar. juin 13, 2017 8:47 am

Re: VBS-SYNTAX PLEASE HELP

Message par 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
Messages : 18622
Inscription : mar. juin 10, 2003 7:21 pm

Re: VBS-SYNTAX PLEASE HELP

Message par 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
Messages : 1190
Inscription : mar. juin 13, 2017 8:47 am

Re: VBS-SYNTAX PLEASE HELP

Message par 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 : Tout sélectionner

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

Code : Tout sélectionner

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
Dernière modification par Erwin Hanzl le jeu. mars 07, 2019 1:26 am, modifié 2 fois.
MMW 4.1.31.1919 Gold-Standardinstallation
Peke
Messages : 18622
Inscription : mar. juin 10, 2003 7:21 pm

Re: VBS-SYNTAX PLEASE HELP

Message par Peke »

Hi,
As I pointed you need to use

Code : Tout sélectionner

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

Code : Tout sélectionner

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
Messages : 1190
Inscription : mar. juin 13, 2017 8:47 am

Re: VBS-SYNTAX PLEASE HELP

Message par Erwin Hanzl »

gelöscht
Dernière modification par Erwin Hanzl le mer. mars 06, 2019 2:58 pm, modifié 2 fois.
MMW 4.1.31.1919 Gold-Standardinstallation
Erwin Hanzl
Messages : 1190
Inscription : mar. juin 13, 2017 8:47 am

Re: VBS-SYNTAX PLEASE HELP

Message par Erwin Hanzl »

Hallo Pavle, GESCHAFFT

ZUSAMMENFASSUNG: Deine Code

Code : Tout sélectionner

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

Code : Tout sélectionner

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 : Tout sélectionner

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

Vielen Dank nochmals für Deine Mühe und Deine Geduld.
Dernière modification par Erwin Hanzl le sam. mars 09, 2019 10:08 am, modifié 3 fois.
MMW 4.1.31.1919 Gold-Standardinstallation
Peke
Messages : 18622
Inscription : mar. juin 10, 2003 7:21 pm

Re: [SOLVED] VBS-SYNTAX PLEASE HELP

Message par 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
Messages : 1190
Inscription : mar. juin 13, 2017 8:47 am

Re: [SOLVED] VBS-SYNTAX PLEASE HELP

Message par 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
Dernière modification par Erwin Hanzl le sam. mars 09, 2019 10:37 am, modifié 1 fois.
MMW 4.1.31.1919 Gold-Standardinstallation
Peke
Messages : 18622
Inscription : mar. juin 10, 2003 7:21 pm

Re: [SOLVED] VBS-SYNTAX PLEASE HELP

Message par 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
Répondre