---
title: "Application eller function"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/54672-application-eller-function"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "Addeladde"
published: "2002-09-30T11:27:17.000Z"
updated: "2002-09-30T14:16:15.000Z"
replies: 1
views: 184
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/54672-application-eller-function"
---

# Application eller function

## #1 — Addeladde, 2002-09-30T11:27Z

Hej

Jag hade tänkt lägga en bit kod i en funktion eller på något annat sätt så att jag kan anropa koden på alla sidor där jag inkluderar functionsfilen. Hur gör jag detta?

koden som jag ska inkludera är:

```
set AP = Server.CreateObject("AdminimizerPro.Editor")
AP.ConfigFilePath = "E:\Jobb\Content_Management\Webbsidan\konfiguration.xml"
AP.StyleSheet = "AL.css"
AP.CopyVisible = True    
AP.BoldVisible = True
```

Hur ser anroppet ut på sidan där jag vill ha med koden?

Permalänk: https://www.webforum.nu/p/54672

## #2 — Ekström, 2002-09-30T14:16Z

```
Function Whatever()
Set AP = Server.CreateObject("AdminimizerPro.Editor")
AP.ConfigFilePath = "E:\Jobb\Content_Management\Webbsidan\konfiguration.xml"
AP.StyleSheet = "AL.css"
AP.CopyVisible = True    
AP.BoldVisible = True
whatever = "hej"
End Function
```

Ska den inte returnera något använder du en sub.

```
Sub Whatever()
Set AP = Server.CreateObject("AdminimizerPro.Editor")
AP.ConfigFilePath = "E:\Jobb\Content_Management\Webbsidan\konfiguration.xml"
AP.StyleSheet = "AL.css"
AP.CopyVisible = True    
AP.BoldVisible = True  
End Sub
```

Anropar den gör du med 

```
call Whatever()
```

Permalänk: https://www.webforum.nu/p/803429

---

Tråden på webben: https://www.webforum.nu/amne/asp/54672-application-eller-function
